RAD Studio |  |

E2408: Default values may be specified only in primary class template declarations (C++)

Template functions, and class partial specializations, may not use default expressions in their template parameter lists. Only primary template declarations may do this. For example:

Copy Code

    template<class T = int>
    class foo;// OK: primary class template
    template<class T = int>
    void bar();// error: template function
    template<class T = int>
    class foo<T *>;// error: partial specialization

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!