Waarom zijn explicit template specializations niet, en partial template specializations wél binnen een class definitie toegestaan?
C++:
1
2
3
4
5
6
7
8
9
10
11
| struct A { template <typename T1, typename T2> struct B {}; template <typename T1> // Ok: partial specialisation struct B<T1, void> {}; template <> // Error: explicit specialization struct B<void, void> {}; }; |
Comeau zegt:
error: explicit specialization is not allowed in the current scope