E2411 Declaration of member function default parameters after a specialization has already been expanded (C++)

From RAD Studio
Jump to: navigation, search

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

If a member function of a class template is declared, and then a specialization of that class implicitly instantiated, and later that member function defined with default parameters specified, the above error will result. For example:

template<int i>
class foo {
void method(int a, int b = i);
};
foo<10> x;
template<int i>
void foo<i>::method(int a = i, int b);  // error!