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 C2799

the template parameter list for 'function' is incompatible with the template parameter list for class 'class'

The number of arguments for the template class differs from the number of parameters for the member function definition.

For example, the following code generates C2799:

typedef  unsigned char   wchar_t;

template <typename CHARTYPE>
class DefaultCStringIterator
{
public:
   CHARTYPE* CharNext(const CHARTYPE* pChar);
};

template <>
class DefaultCStringIterator<wchar_t>
{
public:
   wchar_t* CharNext(const wchar_t* pChar)
   {
      return (wchar_t*) pChar++;
   }
};

template <>
class DefaultCStringIterator<char>
{
public:
   char* CharNext(const char* pChar)
   {
      return (char*) pChar++;
   }
};

template <typename CHARTYPE = char,
         class CStringIterator = DefaultCStringIterator<CHARTYPE> >
class CString_t : public CStringIterator
{
public:
// Constructors
   CString_t();
};

template <typename CHARTYPE>
inline CString_t<CHARTYPE>::CString_t()
{ 
   Init();
}

void main()
{
   CString_t<> myString;
}