Template functions

Started by
1 comment, last by philscott 21 years, 5 months ago
I take it that specifying a constant data item as a template argument only applies to template classes. e.g: When I provide int x as an argument between the <> brackets and call the function twice with different values for x the compiler only creates one function using only one constant value for x. Could anyone tell us why? Cheers. [edited by - philscott on November 10, 2002 3:59:25 PM]
Advertisement
Two possibilities come to mind immediately:
1) You have a non-compliant (broken) compiler.
2) One of the calls is being optimized away.

Without seeing more context on the problem (e.g. code) its hard to say which is true, or if a third reason might exist.
MSVC++6 is broken in this regard.

This topic is closed to new replies.

Advertisement