N4388: A Proposal to Add a Const-Propagating Wrapper to the Standard Library -- J Coe, R Mill

New WG21 papers are available. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N4388

Date: 2015-02-25

A Proposal to Add a Const-Propagating Wrapper to the Standard Library

by Jonathan Coe, Robert Mill

Excerpt:

We propose the introduction of a propagate_const wrapper class that propagates const-ness to pointer-like member variables. ... The behaviour of const member functions on objects with pointer-like data members is seen to be surprising by many experienced C++ developers. A const member function can call non-const functions on pointer-like data members and will do so by default without use of const_cast...

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.