New paper: N3527, optional -- Fernando Cacciola and Andrzej Krzemieński

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

Date: 2013-03-10

A proposal to add a utility class to represent optional objects (Revision 3)

by Fernando Cacciola and Andrzej Krzemieński

Excerpt:

Class template optional<T> proposed here is a type that may or may not store a value of type T in its storage space. Its interface allows to query if a value of type T is currently stored, and if so, to access it. The interface is based on Fernando Cacciola's Boost.Optional library, shipping since March, 2003, and widely used. It requires no changes to core language, and breaks no existing code.

Add a Comment

Comments are closed.

Comments (1)

0 0

rob.desbois said on Mar 19, 2013 08:43 AM:

Just a minor suggestion on wording: how about using 'active'/'inactive' instead of 'engaged'/'disengaged' to refer to the initialization state of a std::optional? An existing precedent I think is sufficiently similar is in [class.union], which refers to the 'active' member of a union.