New paper: N3723, Extend operator-> to support rvalues -- Pascal Costanza

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

Date: 2013-08-23

Extend operator-> to support rvalues

by Pascal Costanza

Excerpt:

We propose the following extension of C++ to enable user-provided definitions for operator-> that support move semantics:

  • A user can choose to implement operator-> with an additional parameter of type int. If this definition is called, the parameter will have the value zero. A user can either implement operator-> with or without this additional parameter for a given class. It is invalid to provide both definitions for a given class.
  • The return value of operator-> with the additional parameter is a complete class type, and the compiler generates a member access with the dot . operator on that return value instead of using the arrow -> operator.

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.