E2480 Cannot involve template parameters in complex partial specialization arguments (C++)

From RAD Studio
Jump to: navigation, search

Go Up to Compiler Errors And Warnings (C++) Index

A partial specialization cannot reference other template parameters in a nonvalue argument expression, unless it is simply a direct reference to the template parameter. For example:

template<int A, int B, int C> class foo;
template<int A> class foo<A+5, A, A+10>;

The partial specialization has two illegal arguments. 'A+5' is a complex expression because it uses 'A' in a manner other than as merely a direct argument. The reference to plain 'A' in the second argument is fine, but the third argument is also illegal because it references 'A' in a complex manner as well.