E
er
hi,
could someone please help with this code?
template<unsigned int N,unsigned int M>
class A{
public:
A();
};
template<unsigned int N,unsigned int M>
A<N,M>::A(){};//fine
//intended: partial specialization
template<unsigned int N>
A<N,0>::A(){};//not fine//see compiler error below
make -k all
Building file: ../main.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -
MT"main.d" -o"main.o" "../main.cpp"
.../main.cpp:6:3: warning: no newline at end of file
.../header.hpp:16: error: invalid use of undefined type 'class A<N,
0u>'
.../header.hpp:5: error: declaration of 'class A<N, 0u>'
.../header.hpp:16: error: template definition of non-template 'A<N,
0u>::A()'
make: *** [main.o] Error 1
make: Target `all' not remade because of errors.
could someone please help with this code?
template<unsigned int N,unsigned int M>
class A{
public:
A();
};
template<unsigned int N,unsigned int M>
A<N,M>::A(){};//fine
//intended: partial specialization
template<unsigned int N>
A<N,0>::A(){};//not fine//see compiler error below
make -k all
Building file: ../main.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -
MT"main.d" -o"main.o" "../main.cpp"
.../main.cpp:6:3: warning: no newline at end of file
.../header.hpp:16: error: invalid use of undefined type 'class A<N,
0u>'
.../header.hpp:5: error: declaration of 'class A<N, 0u>'
.../header.hpp:16: error: template definition of non-template 'A<N,
0u>::A()'
make: *** [main.o] Error 1
make: Target `all' not remade because of errors.