In MSVC2010, the following code gives:
error C2039: 'my_type' : is not a member of ''global namespace''
template<typename T>
class C
{
public:
typedef T my_type;
};
C<int> c;
auto f = [&c]() {
decltype(c)::my_type v2; // ERROR C2039
};
I found a lame way around this, but I'm wondering how to get to typedef correctly when you only have an instance of the object.
tukra source
share