effective c++
Item-27 Minimize_casting
· β˜• 7 min read

Avoid casts and develop a cast-free alternative whenever practical, especially dynamic_cast in performance-sensitive code.


Item-25 Consider support for a non-throwing swap
· β˜• 7 min read

When std::swap would be inefficient for your type,provide a non-throwing swap member function, a non-member swap calling the member, and possibly a specialized std::swap for the case of classes (not templates).