AFAIR, it is not possible to get a type from an object, only from a type. Even with auto, you can only instantiate another type of the same type.
Is this still the case?
I'd like to get a type from an object given another type, mainly because it is less typing and less error prone.
Some psudocode:
1 2 3
Type1 A<X, Y> a;
int b;
Type2 a.InnerType<b>::type c; // obviously won't work
A work around I thought of would be to use functions:
1 2 3
Type1 A<X, Y> a;
int b;
auto c = a.getInnerType(b);
Which is kinda interesting and looks like the way I'm going to go. However, I'm just wondering if there is any other ways of doing this as I don't really want to instantiate an object if I can avoid it (though the optimizer will probably just dump it anyway).