New paper: N3568, Shared locking in C++, Revision 1 -- Howard Hinnant

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

Date: 2013-03-11

Shared locking in C++, Revision 1

by Howard Hinnant

Excerpt:

N3427 was presented at the Fall 2012 meeting in Portland to SG1 (Concurrency and Parallelism). The only objection at that meeting was to not allowing spurious failure for the try and timed locking and conversion locking functions of shared_mutex and upgrade_mutex.

Changes compared to N3427: The remarks about disallowing spurious failures have been removed.

...

This proposal adds functionality to allow clients to easily code the well-known multiple-readers / single-writer locking pattern.
This proposal adds:

1. Seven constructors to unique_lock<Mutex>These constructors serve as explicit try and timed conversions from shared_lock and upgrade_lock.

2. A new header: <shared_mutex>, containing:

  • class shared_mutex;
  • class upgrade_mutex;
  • template <class Mutex> class shared_lock;
  • template <class Mutex> class upgrade_lock;

New paper: N3553, Proposing a C++1Y Swap Operator -- 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: N3553

Date: 2013-03-12

Proposing a C++1Y Swap Operator

by Walter Brown

Excerpt:

This paper proposes a new swap operator for incorporation into C++1Y. It further proposes that this new operator be treated as a special member function, and that, when viable, its presence provide an alternative to traditional memberwise implementation of defaulted assignment semantics.

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.