NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Compiler Error C2899

typename cannot be used outside a template declaration

The typename keyword can be used only in a template definition or declaration. In a template declaration, it can be used in two ways:

// One way
template<typename T> class X {};

// Another way
template<class T> struct X {
   typename T::A a;   // T::A is a type
};

Example

struct Y {
   typedef int B;
   typename Y::B b;   //error
};