RAD Studio
ContentsIndex
PreviousUpNext
E2420: Explicit instantiation can only be used at global scope

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

template<class T>
class foo { };
template class foo<char>;// OK: at global scope
int main() {
template class foo<int>:// error: local scope
}
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!