• Advertisement
Sign in to follow this  

templates & cast

This topic is 4736 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, trouble again, type casts are slow ('as far as I know'), do casts in templates decrease the performance, or will the compiler replace the casts of a constant by another constant, greets tgar

Share this post


Link to post
Share on other sites
Advertisement
Depends on the type of cast you perform, templates have no direct influence on the performance of a cast, unless you're dynamic_casting from or to a type specified as an template argument possibly.

Check out this short article for a summary of the four types of casts and the performance impact they cause:
www.lunaticsystems.com/index.php?module=xlink&base=articles&id=cpp_casts

-Markus-

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement