Jump to content
  • Advertisement

Archived

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

blahpers

Who knows what's what about "static_cast<T>()"?

This topic is 6262 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

Alrighty, I''m piecing together a solution, however temporary, to a parallel Bridge pattern problem I posted yesterday in General Graphics (hope somebody responds to that one eventually . . .). To implement it, however, I''d like to use static_cast() rather than an icky C-style downcast. I''m interested in the time-complexity. The C++ FAQs book reports that dynamic_cast() can have linear time complexity to execute at runtime because it may have to search the entire class hierarchy to ensure that it''s a good cast. Does static_cast() have linear complexity? If so, is the time eaten at runtime or compile time? This is kinda silly, since the class hierarchy is pretty small, but it''s also extensible, so I still want to know. --- blahpers

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!