RAD Studio |  |

E2475: 'function' cannot be a template function (C++)
See Also
Collapse All

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:

Copy Code

    template <class T> int main()  // This causes an error
    {}

See Also

Function Templates

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