Skip to content

Type-trait to get scalar type of a nested array type. #1262

Answered by njroussel
frettini asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @frettini

No, we don't have such a trait currently. This will be improved in an upcoming version though: we'll have a dr.replace_type_t.

For now you'd be stuck with either some hacky python thing like mi.getattr("Scalar" + original_type.__name__) or some extra C++ bindings. Depending on what you need, you might as well just make a big switch statement - there aren't that many possibilites.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by njroussel
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants