RAD Studio
ContentsIndex
PreviousUpNext
E2515: Cannot explicitly specialize a member of a generic template class (C++)

You are trying to make a generic template into a specialized member. For example, the following code is illegal:

    template<typename T>
class foo {
template<typename U>
      class bar {
      };
    };
template<typename T>
template<>
class foo<T>::bar<char> {
};

The second declaration in the example is an error, because it tries to explicitly specialize bar<char> within foo<T>.

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