Non Type Template Arguments #5504
Unanswered
TheFloatingBrain
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I looked at this answer #3662
Wanted to ask
0: Are non-type template arguments to my C++ class, type, or function supported? It seems like I have to put in every possible value? I saw something about it in a change log. This would be difficult if it were, say, a floating-point. Even a range of integers would be a lot.
Cython seems to support it [0, 1] though I am thinking is may be because it comes bundled with a compiler?
1: Regarding the code
Does
py::args
contain type information, so potentially I could have a switch statement for different types and use a recursive template to implement the call?2: Is Python typing supported in this way, suppose I had
2.0
Can one do from the Python side?
(wrapping each type of course)
2.1
If non type
Probably using
std::make_index_sequence
to generate each version and wrap it.2.2
Could one use a custom enum here?
Beta Was this translation helpful? Give feedback.
All reactions