Сбой частичной специализации метода с двойным шаблоном

Есть шаблонный класс List.

template <typename Point>
class List
{


    public:
          template <const unsigned short N>
          void load ( const char *file);
          ...
};

template <typename Point>
template <const unsigned short N>
void List <Point>::load ( const char *file)
}

Как специализировать загрузку метода для N = 2? Этот код недействителен ...

template <typename Point>
void List <Point> <2>::load ( const char *file)
{
}

И этот код тоже не работает.

template <typename Point>
void List <Point> ::load <2> ( const char *file )
{ 
}

Error 3 error C2768: 'List<Point>::load' : illegal use of explicit template arguments 66. 
Error 5 error C2244: 'List<Point>::load' : unable to match function definition to an existing declaration 66

Компилятор g ++:

template <typename Point>
template <>
void List <Point> ::load <2> ( const char *file )
{
}

error: explicit specialization in non-namespace scope `class List<>'
error: enclosing class templates are not explicitly specialized
error: default arguments are only permitted for function parameters
error: `load' is not a function template
error: invalid function declaration
7
задан einpoklum - reinstate Monica 13 November 2013 в 16:23
поделиться