RAD Studio
ContentsIndex
PreviousUpNext
E2475: 'function' cannot be a template function

Certain functions, like 'main' and 'WinMain' cannot be declared as a template function. 'main' is the entrypoint of console applications, and 'WinMain' is the entry point of Windows applications. 

For example:

template <class T> int main()  // This causes an error
{}
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!