Archived

This topic is now archived and is closed to further replies.

philscott

Template functions

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites