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

Started by
0 comments, last by blahpers 22 years, 7 months ago
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
---blahpers
Advertisement
static_cast<>() is resolved at compile time.

This topic is closed to new replies.

Advertisement