say we have a struct template taking a class , and a pointer on a member on this class:
struct A<A,&A::a>
I can’t declare template like that
template<class T,class U>
struct{};
I have to write
template<class T,typename T::type var>
struct{};
why &A::a can’t be bind into a simple typename T syntax ? Before to be a pointer on a member, &A::a is a type so we could expect that a simple typename T works but that is not the case
&A::ais a value, not a type. So the template declaration makes no sense.Here’s how it might work:
Or, more generally,