Chapter 9. The function
Class Template
Form ever follows function.
— “The Tall Office BuildingArtistically Considered,”from Lippincott’s MagazineLOUIS HENRI SULLIVAN
One of the drawbacks of template programming is the proliferation of template instantiations. If you write a function template that takes a callable type as one of its type arguments and makes a function call through an object of that type, the code that is generated for an instantiation with a pointer to function is distinct from the code that is generated for an instantiation with a class type T1
that has a function call operator, and that code is distinct from the code that is generated for an instantiation with a different class type T2
that also has a function call operator. ...
Get The C++ Standard Library Extensions A Tutorial and Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.