Q
In a dummy example of a class
typedef myStruct<myStruct<myStruct<int>>> mv;
int
is the innermost template parameter. How can I get the type of that parameter for arbitrary nesting depth?
Desired Result
A mechanism to acquire the innermost type
innermost<mv>::type -> int
WishList
Can this be done using template aliases (template template parameters are a missing feature here)?
In an example where my type would be
vector<vector<vector<int>>>
Is there a way to perform the same operation, given that
vector
expects an extra template parameter ? Ofcourse a distinct implementation could be divised but is there a way to scale the solution for the first problem to handle these cases as well ?
>>` doesn't look like an absurd problem, but wasn't asking for neither the verification nor the extension to varying inner templates (since you thought of the extra problem it would be interesting to see an approach)
– Nikos Athanasiou Aug 08 '14 at 09:10