March 2013

New paper: N3543, Priority Queue, Queue and Stack: Changes and Additions -- G Powell, T Blechmann

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

Date: 2013-03-15

Priority Queue, Queue and Stack: Changes and Additions

by Gary Powell, Tim Blechmann

Excerpt:

Priority Queues, Stacks and heaps are extremely useful data structures suitable for solving many common ordering problems. C++ 2011 provides only a couple of template adaptor classes; priority_queue, stack and queue, which provide limited functionality. To overcome the current limitations, this paper proposes that new containers be added to the standard library to replace the current adaptors which would then be depreciated. Additionally there are several alternative implementations of heaps having different performance characteristics which should be added to the standard library. Especially, the suggested options for these heaps deal with these additional aspects:

  • Iterators: Heaps provide iterators to iterate all elements.
  • Mutability: The priority of heap elements can be modified.
  • Mergeable: While all heaps can be merged, some can be merged efficiently.
  • Stability: Heaps can be configured to be stable sorted.
  • Comparison: Heaps can be compared for equivalence.

New paper: N3542, Proposal for Unbounded-Precision Integer Types -- Pete Becker

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

Date: 2013-03-18

Proposal for Unbounded-Precision Integer Types

by Pete Becker

Excerpt:

This paper proposes two unbounded-precision integer types. The type integer represents signed integer values. The type bits represents an unbounded set of bit values.

To support interoperability, objects of either type can be constructed from values of any of the standard integer types. So code like this just works:

    integer i = 30000;
    integer j = 1000 * i;

    bits b = 0xFF;
    bits c = b & 0xAA;

Converting a negative number to an object of type bits sets the number to the complement of this initializer, so this code just works:

    bits b = -3; // sets b to ...11111100

New paper: N3539, N3540, N3541, Core Language Issues Lists, Revision 83 -- William M. Miller

New WG21 papers are available. Copies are linked below, and 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: N3539, N3540, N3541

Date: 2013-03-18

C++ Standard Core Language Active Issues, Revision 83

C++ Standard Core Language Defect Reports and Accepted Issues, Revision 83

C++ Standard Core Language Closed Issues, Revision 83

by William M. Miller

Excerpt:

The purpose of these documents is to record the disposition of issues that have come before the Core Language Working Group of the ANSI (INCITS PL22.16) and ISO (WG21) C++ Standard Committee.

New paper: N3534, C++ {Pipelines -- Adam Berkan, Alasdair Mackintosh

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

Date: 2013-03-15

C++ Pipelines

by Adam Berkan, Alasdair Mackintosh

Excerpt:

We propose a C++ pipeline library that allows application programmers to combine simple data transformations into a complete multithreaded data-processing pipeline. Individual transformation functions are isolated from each other, and may be run in parallel. We use a pipe syntax that should be familiar to users of Unix or Microsoft shells.

(pipeline::from(input_queue) |
  bind(grep, "^Error") |
  bind(vgrep, "test@example.com") |
  bind(sed, "'s/^Error:.*Message: //") |
  output_queue).run(&threadpool);
Although not universally applicable, we believe that this approach will simplify the writing of certain classes of data-processing applications.

New paper: N3530, Leveraging OpenMP infrastructure for language level parallelisation -- Gove et al.

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

Date: 2013-03-15

Leveraging OpenMP infrastructure for language level parallelisation

by Darryl Gove, Nawal Copty, Michael Wong

Excerpt:

This proposal suggests how language level parallelisation can be achieved using the existing OpenMP infrastructure. OpenMP is a mature, well established and widely used specification for writing portable multi-threaded applications on a shared memory system.

New paper: N3525, Polymorphic Allocators -- Pablo Halpern

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

Date: 2013-03-18

Polymorphic Allocators

by Pablo Halpern

Excerpt:

A significant impediment to effective memory management in C++ has been the inability to use allocators in non-generic contexts. In large software systems, most of the application program consists of non-generic procedural or object-oriented code that is compiled once and linked many times. Allocators in C++, however, have historically relied solely on compile-time polymorphism, and therefore have not been suitable for use in vocabulary types, which are passed through interfaces between separately-compiled modules, because the allocator type necessarily affects the type of the object that uses it. This proposal builds upon the improvements made to allocators in C++11 and describes a set of facilities for runtime polymorphic allocators that interoperate with the existing compile-time polymorphic ones. In addition, this proposal improves the interface and allocation semantics of some of library classes, such as std::function, that use type erasure for allocators.

New paper: N3522, C++ Standard Library Issues List (Revision R82) -- Alisdair Meredith

New WG21 papers are available. Copies are linked below, and 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: N3522, N3523, N3524

Date: 2013-03-18

C++ Standard Library Active Issues List (Revision R82)

C++ Standard Library Defect Report List (Revision R82)

C++ Standard Library Closed Issues List (Revision R82)

by Alisdair Meredith

Excerpt:

The purpose of this document is to record the status of issues which have come before the Library Working Group (LWG) of the INCITS PL22.16 and ISO WG21 C++ Standards Committee.

Quick Q: Why use C varargs when you have initializer_lists and variadic templates? -- StackOverflow

Quick A: No reason, varargs are type-unsafe and entirely superseded by C++11 features (unless you need C compatibility).

Why use variadic arguments now when initializer lists are available?

I've been wondering what are the advantages of variadic arguments over initializer lists. Both offer the same ability -- to pass indefinite number of arguments to a function.

 

What I personally think is initializer lists are a little more elegant. Syntax is less awkward.

Also, it appears that initializer lists have significantly better performance as the number of arguments grows.

 

So what am I missing, besides the possibility to use use variadic arguments in C as well?

New paper: N3560, Proposal for Assorted Extensions to Lambda Expressions -- Faisal Vali et al.

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

Date: 2013-03-17

Proposal for Assorted Extensions to Lambda Expressions

by Faisal Vali, Herb Sutter, Dave Abrahams

Excerpt:

We propose extensions to lambda expressions motivated by the general view that lambda expressions should allow for a concise and complete description of a callable unit of computation. In addition to containing those features from document N3418: Proposal for Generic (Polymorphic) Lambda Expressions that received against votes in Portland (2012), it also contains other small extensions to lambdas. We also present our experience implementing some of the features using Clang.

... The aim of this paper is to propose various extensions to lambda expressions (generic and non-generic) to simplify and enhance their use. This proposal builds on N3559 (which defines a generic lambda). We assume the reader is familiar with C++11 lambdas and the content of N3559.

It is important to note that not all the authors of this paper are in favor of each and every one of these proposed features and the purpose of this paper is to seek guidance from the EWG regarding which features are worth pursuing further.