• Create Account

Posted 21 June 2013 - 04:39 PM

Hi, I seem to having a little trouble with something that is seemingly simple.

I would like to get a typedef from my own traits class where the template is instantiated based on a member T::member.

It would be easier to just show an example of what I'm talking about

template <typename T> class someclass
{
public:
// doesnt work
typedef ns::some_traits<decltype(T::member)>::type type;
};

// works
typedef ns::some_traits<decltype(otherclass::member)>::type type;


To me this looks like I'm missing a typename somewhere in there but I've tried that in a number of variations.

Could it be a compiler bug (which I doubt)? I'm using the Visual C++ November 2012 CTP compiler.  If not what is the problem here?

Posted 21 June 2013 - 04:38 PM

Hi, I seem to having a little trouble with something that is seemingly simple.

I would like to get a typedef from my own traits class where the template is instantiated based on a member T::member.

It would be easier to just show an example of what I'm talking about

template <typename T> class someclass
{
public:
// doesnt work
typedef ns::some_traits<decltype(T::member)>::type type;
};

// works
typedef ns::some_traits<decltype(otherclass::member)>::type type;


To me this looks like I'm missing a typename somewhere in there but I've tried that in a number of variations.

Could it be a compiler bug (which I doubt)? I'm using the Visual C++ November 2012 CTP compiler.  If not what is the problem here?