Two fundamental implementations for one conceptual task

Save to:
Instapaper Pocket Readability

From the Modern Maintainable Code blog:

Two fundamental implementations for one conceptual task

by Mark Isaacson


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.

Add a Comment

You must sign in or register to add a comment.

Comments (0)

There are currently no comments on this entry.