New paper: N3596, Code Reuse in Class Template Specialization -- Peter Gottschling

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N3596

Date: 2013-03-15

Code Reuse in Class Template Specialization

by Peter Gottschling

Excerpt:

The possibility to define specializations of class templates offers an enormous liberty unthinkable in most other languages. Techniques like enable_if would not be possible without this flexibility.

However, in my (personal) experience over 90% of class specializations duplicate over 80% of the implementation. Conversely, the flexibility praised before is only used in few template classes and paid by code duplications in many classes. We propose a simple extension that provides full
backward compatibility and avoids a lot of duplications.

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.