March 2013

New paper: N3552, Introducing Object Aliases -- 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: N3552

Date: 2013-03-12

Introducing Object Aliases

by Walter Brown

Excerpt:

A number of years ago, [Bro05] explored a prospective language feature then known as Object Templates. That feature died on the vine due to healthy skepticism voiced by EWG, as well as the usual lack of cycles to develop the idea much further. However, the original underlying issue is still present in C++11, after even many additional years of experimental effort to achieve the desired effect via C++03 or (more recently) C++11 syntax.

Fortunately, C++11 also points the way toward a more general solution, well beyond that envisioned over a decade ago. Accordingly, this paper incorporates and updates a significant fraction of the earlier [Bro05] in introducing a different proposed C++ feature. Inspired by the C++11 template alias for types, we will propose a template alias for objects, known in brief as an object alias.

New paper: N3551, Random Number Generation in C++11 -- Walter Brown

Ed.: Most standardization papers are about technical changes. It's not often you get a tutorial written by a world-class expert submitted as a WG21 paper. Thanks, Walter!

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

Date: 2013-03-12

Random Number Generation in C++11

by Walter Brown

Excerpt:

For programmers seeking to familiarize themselves with the <random> component of the
C++11 standard library, we provide background information and tutorial guidance with numerous
usage examples.

1 Introduction 1
2 Getting started 2
3 An anti-pattern 3
4 Initializing an engine 3
5 What else can an engine do? 4
6 Engines in the standard library 5
7 Sharing an engine 5
8 Distributions in the standard library 6
9 What else can a distribution do? 8
10 A simple toolkit 9
11 A final example 9
12 Caveat lector! 10
13 What’s next? 11
14 Acknowledgments 11
15 Bibliography 11
16 Revision history 12

New paper: N3550, Proposed C++14 Value Classification -- 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: N3550

Date: 2013-03-12

Proposed C++14 Value Classification

by Walter Brown

Excerpt:

Because the C++11 value classification scheme is widely distributed throughout the text of the standard, it seems unnecessarily difficult to assess the global impact of the direction suggested in the last paragraph of [CWG issue 1585]. We therefore propose a centralized specification of the scheme.

... Independent of the outcome of CWG 1585, we propose to centralize the specification of value classification, and correspondingly to excise the current widely distributed specifications.

New paper: N3549, s/bound/extent/ -- 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: N3549

Date: 2013-03-12

s/bound/extent/

by Walter Brown

Excerpt:

The C++11 standard uses two distinct terms of art to denote an array’s number of elements. For the sake of consistency, as well as improved technical accuracy, this paper proposes to adopt a single term of art throughout the standard.

New paper: N3548, Conditionally-supported Special Math Functions for C++14 -- 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: N3548

Date: 2013-03-12

Conditionally-supported Special Math Functions for C++14

by Walter Brown

Excerpt:

This paper proposes to merge International Standard 29124:2010, “Extensions to the C++
Library to support mathematical special functions,” into C++14 as a conditionally-supported
standard library feature.

New paper: N3547, Three -related Proposals -- 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: N3547

Date: 2013-03-12

Three <random>-related Proposals

by Walter Brown

Excerpt:

This paper proposes (1) to add one function template to <algorithm>, (2) to add a few novice-friendly functions to <random>, and (3) to deprecate some related legacy interfaces. The unifying factor in this tripartite proposal is the entities’ respective connection with random numbers.

New paper: N3546, TransformationTraits Redux -- 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: N3546

Date: 2013-03-12

TransformationTraits Redux

by Walter Brown

Excerpt:

This paper proposes to augment C++11’s TransformationTraits with a number of template
aliases whose use dramatically simplifies the traits’ most common applications.

New paper: N3545, An Incremental Improvement to integral_constant -- 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: N3545

Date: 2013-03-12

An Incremental Improvement to integral_constant

by Walter Brown

Excerpt:

This paper proposes to add a constexpr operator() to the synopsis of integral_constant
in order to allow the template to serve as a source of compile-time function objects.

New paper: N3537, Clarifying Memory Allocation -- Lawrence Crowl and Chandler Carruth

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

Date: 2013-03-12

Clarifying Memory Allocation

by Lawrence Crowl and Chandler Carruth

Excerpt:

The allocation and deallocation of memory has become a significant expense in modern systems. ...

An essential requirement on implementations is that they deliver usable memory, not that they have a particular sequence of calls. We propose to explicitly decouple the implementation calls from the abstract calls. ... Together these changes enable implementations to reduce the number of malloc calls by avoiding them or fusing them. However, it would only enable fusing mallocs together into larger mallocs provided it can prove that both mallocs have overlapping lifetimes (ended by corresponding calls to free) such that the peak allocated memory of the program remains unchanged.

New paper: N3533, C++ Concurrent Queues -- Lawrence Crowl and Chris Mysen

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

Date: 2013-03-12

C++ Concurrent Queues

by Lawrence Crowl and Chris Mysen

Excerpt:

This paper revises N3434 = 12-0043 - 2012-01-14 as follows.

  • Add more exposition.
  • Provide separate non-blocking operations.

  • Add a section on the lock-free queues.
  • Argue against push-back operations.

  • Add a cautionary note on the usefulness of is_closed().
  • Expand the cautionary note on the usefulness of is_empty(). Add is_full().

  • Add a subsection on element type requirements.
  • Add a subsection on exception handling.

  • Clarify ordering constraints on the interface.
  • Add a subsection on a lock-free concrete queue.

  • Add a section on content iterators, distinct from the existing streaming iterators section.
  • Swap front and back names, as requested.

  • General expository cleanup.
  • Add an 'Revision History' section.