Consider the following code:
template<class T, class F> struct X {};
template<class T, class F, T F::* m> struct Y {};
struct Foo {
int member;
typedef X<int, Foo> x_type; // works well
typedef Y<int, Foo, &Foo::member> y_type; // ERROR
};
typedef Y<int, Foo, &Foo::member> y_type2; // OK
Why does compiler generate error? (VS2008)
New
I have posted this bug to connect.microsoft.com.
I think that it is related somehow with that Visual C++ don't know the size of pointer to member at that point. Check this defect report for instance (here is another problem with pointer to member variable). I think that you found one more Visual C++ bug and it should be reported to connect.microsoft.com.
This is a bug
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With