Skip to main content
gamedev.net
🔒 Locked

Template functions

Started by philscott Nov 10, 2002 at 2:56 PM 1 replies 300+ views
Original Post
philscott
philscott
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]
SiCrane
SiCrane
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.
SabreMan
SabreMan
MSVC++6 is broken in this regard.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.