Summary
Team LiB
Previous Section Next Section

Summary

Specialization is good only when it can be done correctly: When extending someone else's function template (including std::swap), avoid trying to write a specialization; instead, write an overload of the function template, and put it in the namespace of the type(s) the overload is designed to be used for. (See Item 57.) When you write your own function template, avoid encouraging direct specialization of the function template itself.

    Team LiB
    Previous Section Next Section