Generic function returning type of component type #23775
Unanswered
pd-giz-dave
asked this question in
Questions and Answers
Replies: 1 comment
-
allow generic types to be compile time expressions |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a generic function that is given the type of a struct that always has a component 'x' that is of another type, I want the function to return a value of the type of 'x'. How do I do that?
E.g.
The clunky way to do it is:
But that is redundant and the call site becomes messy:
Beta Was this translation helpful? Give feedback.
All reactions