Does std::static_pointer_cast have any additional runtime overhead?

Viewed 3642

Compared to static_cast, that is. So, if we have these two casts

Base* b(new Derived());
Derived* d = static_cast<Derived*>(b); // (1)

shared_ptr<Base> b(new Derived());
shared_ptr<Derived> d = static_pointer_cast<Derived>(b); // (2)

will line (2) be slower than line (1)?

2 Answers
Related