Two fundamental implementations for one conceptual task
From the Modern Maintainable Code blog:
Two fundamental implementations for one conceptual task
by Mark Isaacson
Summary:
This is the second article of a series on code reuse. This article provides a discussion of how to approach the problem of having multiple implementations of a single idea and how to programmatically select between them based on patterns in the type information of the parameters.
Out in the real world, functions like
use the same techniques discussed to leverage std::memcpy internally when it's safe to do so.
<span 1;"="">You can find the previous article of the series here, and the prelude to the next, which looks at solving the same problem for structs instead of functions, here.

Earlier this month,
C++11/C++14 will become more and more important in the C++ ecosystem, eventually becoming the most prevalent versions used. Every professional developer should invest in learning the new language version and try introducing its benefits into projects. And for good reasons: C++11/C++14 bring a large range of new features that make development safer, faster, easier and more fun. Once you have tried features like lambda functions, range-based for loops, the auto keyword and the new initialization syntax, you won’t want to go back. In addition to that, many more advanced features like variadic templates, rvalue reference and of course the new standard library additions like multithreading classes, smart pointers, regular expressions and new containers and algorithms complete the picture.