New paper: N3741, Toward Opaque Typedefs for C++1Y, v2 -- Walter Brown

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: N3741

Date: 2013-08-30

Toward Opaque Typedefs for C++1Y, v2

by Walter Brown

Excerpt:

Although this paper is self-contained, it logically follows our discussion, begun several years ago in
N1706 and continued in N1891, of a feature oft-requested for C++: an opaque typedef, sometimes
termed a strong typedef. The earlier of those works was presented to WG21 on 2004-10-20 during
the Redmond meeting, and the later work was presented during the Berlin meeting on 2005-04-06.
Both presentations resulted in very strong encouragement to continue development of such a
language feature. Alas, the press of other obligations has until recently not permitted us to
resume our explorations.

Now with C++11 as a basis, we return to the topic. Where our earlier thinking and nomenclature
seem still valid, we will repeat and amplify our exposition; where we have new insights, we will
follow our revised thinking and present for EWG discussion a high-level proposal for a C++1Y
language feature to be known as an opaque alias. ...

Add a Comment

Comments are closed.

Comments (2)

0 0

Enis Bayramoglu said on Aug 30, 2013 09:57 PM:

I think what's proposed here is very similar to regular inheritance, except that it also allows "inheriting" from non-class types. IMHO such a small difference doesn't justify such a drastic syntactic addition to the language. One option could be to allow inheriting from non-class types instead, but Bjarne states good reason against it (due to C compatibility). Then another option is to define class versions of the non-class types in the standard library, such as Integer and Double just like java, so that programmers can conveniently inherit from these for finer control.
0 0

Bojek said on Sep 16, 2013 02:09 PM:

How about easy way to add user-defined literal for new type?