October 2014

N4175: Default comparisons -- Bjarne Stroustrup

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

Document number: N4175

Date: 2014-10-11

Default comparisons

by Bjarne Stroustrup

Excerpt:

Defining comparison operators (==, !=, <, <=, >, and >=) for simple classes is tedious, repetitive, slightly error-prone, and easily automated. I propose to (implicitly) supply default versions of these operations, if needed. The semantics of = is equality of every member. The meaning of < is a lexicographical order of elements. If the simple defaults are unsuitable for a class, a programmer can, as ever, define more suitable ones or suppress the defaults.

N4174: Call syntax: x.f(y) vs. f(x,y) -- Bjarne Stroustrup

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

Document number: N4174

Date: 2014-10-11

Call syntax: x.f(y) vs. f(x,y)

by Bjarne Stroustrup

Excerpt:

This note explores the possibility of providing a uniform call syntax by giving member functions preference over non-member functions. Offering the choice between the x.f(y) and f(x,y) notations with different meanings means that different people will chose differently for their function definitions, so that users have to know the choice and write calls appropriately. This gives users more opportunities for making mistakes, makes it harder to write generic code, and has led to replication when people define both a member and a non-member function to express the same thing. I suggest that providing different meanings to the two syntaxes offers no significant advantage.

N4173: Operator Dot -- Bjarne Stroustrup and Gabriel Dos Reis

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

Document number: N4173

Date: 2014-10-11

Operator Dot

by Bjarne Stroustrup and Gabriel Dos Reis

Excerpt:

This is a proposal to allow user-defined operator dot (operator.()) so that we can provide “smart references” similar to the way we provide “smart pointers.” The gist of the proposal is that if an operator.() is defined for a class Ref then by default every operation on a Ref object is forwarded to the result of operator.(). However, an operation explicitly declared as a member of Ref is applied to the Ref object without forwarding. A programmer can prevent a pointer to a referred-to object from “leaking” into the larger program by declaring operator.() private.

N4221: Generalized lifetime extension -- David Krauss

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

Document number: N4221

Date: 2014-10-10

Generalized lifetime extension

by David Krauss

Excerpt:

A model is introduced to describe the association between a value, and the object or objects needed to represent it. This enables a generalization of lifetime extension, applicable to constructors and accessor functions which opt in using the export keyword. The current lifetime extension behavior is also more elegantly described, and the “temporary expression” controversy is resolved. This resolves EWG 120 and many other dangling reference issues.

N4220: An update to the preprocessor specification (rev. 2) -- David Krauss

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

Document number: N4220

Date: 2014-10-10

An update to the preprocessor specification (rev. 2)

by David Krauss

Excerpt:

This proposal updates the preprocessor specification to remove undefined behavior, missing specifications, and possible contradictions, and to better document implementation differences. It resolves CWG DR 268, 366, 897, 1436, 1625, 1698, 1709, 1718, and 1882. Issues related to universal-character-names are not addressed here, but in N4219.

N4219: Fixing the specification of universal-character-names (rev. 2) -- David Krauss

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

Document number: N4219

Date: 2014-10-10

Fixing the specification of universal-character-names (rev. 2)

by David Krauss

Excerpt:

The present paper will review several corner cases, considering the natural response of models A, B, and C, and the actual behavior of GCC and Clang. This leads to a specification permitting implementation flexibility without ambiguity.

N4211-13: File System TS Issues Lists -- Beman Dawes

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 numbers: N4211-13

Date: 2014-10-11

File System TS Active Issues List (Revision R3)

File System TS Closed Issues List (Revision R3)

File System TS Defect Report List (Revision R3)

by Beman Dawes

Overload 123 is now available

overload-123.PNGOverload 123 is now available. It contains the following C++-related articles, and more:

 

Overload 123

Alternative Overloads

[No pun intended. --Ed.] How do you return a default value given a condition? Malcolm Noyes presents solutions using older and newer C++ techniques.

Debug Complexity: How Assertions Affect Debugging Time

Debugging any program can be time consuming. Sergey Ignatchenko and Dmytro Ivanchykhin extend their mathematical model to consider the effect of assertions.

Defining Visitors Inline in Modern C++

The Visitor pattern can involve non-local boilerplate code. Robert Mill and Jonathan Coe present an inline VISITOR in C++.

N4183: Contiguous Iterators: Pointer Conversion & Type Trait -- Nevin Liber

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

Document number: N4183

Date: 2014-10-10

Contiguous Iterators: Pointer Conversion & Type Trait

by Nevin Liber

Excerpt:

This is a proposal to:

  • Add a mechanism for converting a contiguous iterator to a pointer
  • A type trait for contiguous iterators
It builds upon the discussion in Issaquah on the previous version of this paper (n3884) and is dependent on n4132 Contiguous Iterators by Jens Maurer.

N4190: Removing auto_ptr, random_shuffle(), And Old Stuff -- Stephan T. Lavavej

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

Document number: N4190

Date: 2014-10-09

Removing auto_ptr, random_shuffle(), And Old Stuff

by Stephan T. Lavavej

Excerpt:

The C++ Standard is big.  We should make it smaller by removing stuff we don't need anymore, like features that have been deprecated for years and thoroughly superseded by more modern machinery.