RAD Studio |  |

E2420: Explicit instantiation can only be used at global scope (C++)

Explicit instantiation cannot be specified at any level other than namespace or global scope. For example:

Copy Code

    template<class T>
    class foo { };
    template class foo<char>;// OK: at global scope
    int main() {
    template class foo<int>:// error: local scope
    }

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