March 2014

Classic C++ Files: Sixteen Ways to Stack a Cat -- Bjarne Stroustrup

For your Friday reading pleasure, here's a classic paper showing off C++'s flexibility with a wink and a smile.

Although it doesn't exercise the new features of modern C++, we believe all of the code still works. How's that for backward compatibility...

Sixteen Ways to Stack a Cat

by Bjarne Stroustrup

From the article:

This paper presents a series of examples of how to represent stacks in a program. In doing so it demonstrates some of the fundamental techniques and tradeoffs of data hiding as seen in languages such as C, Modula2, and Ada. Since all the examples are written in C++ it also demonstrates the flexibility of C++’s mechanisms for expressing data hiding and access.

... The nine-plus cat lives in this paper are dedicated to Dave McQueen who once in desperation proposed the death penalty for presenting "yet another stack example." Also thanks to Andy for giving me a practical demonstration of the difficulty of stacking cats.

Compiler support for C++11 and C++14

C++11 support is still an interesting topic, even that GCC and Clang now fully support it. Also the upcoming C++14 standard is already getting implemented by a lot of compilers. There are two very interesting publications about this topic in recent weeks, first, on italiancpp.org there is a PDF on C++11 and C++14 feature support for Visual C++, Intel, Clang and GCC. Also Just a few days ago, a interesting blogpost about this topic was published on C++Rocks, focussing on compiler and library support:

C++11/14 compiler and library shootout

by C++ Rocks

From the Article:

It’s been almost a year since my last comparison of C++11 support across different compilers, so I decided to take a break from working on my book about C++11/14 features in VS2013, and see how things have changed.

N3966: Fixes for optional objects -- Fernando Cacciola, Andrzej KrzemieĊ„ski

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

Date: 2014-03-01

Fixes for optional objects

by Fernando Cacciola, Andrzej Krzemieński

Excerpt:

This document proposes a number of wording fixes, as suggested in Issaquah meeting, to optional objects proposed in N3793. We do not propose any changes in the functionality. We only reworded the standardese, and applied bug fixes: ...

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

Date: 2014-02-28

Proposal for Unbounded-Precision Integer Types

by Pete Becker

Excerpt:

Programmers sometimes need to manipulate integer values that are too large to repesent with C++’s standard integer types. Doing a Google search for terms that describe large integers produces many hits for libraries that handle large integers. These libraries vary in quality, from hacks by beginners to sophisticated, professional implementations. Also, Java has unbounded precision integers as part of its standard class library.

One important use for unbounded-precision integers is cryptography. Cryptographic applications typically manipulate integer values of several hundred digits. If the C++ standard library provides facilities for such values it will make cryptographic applications easier to write and to port.

There have been two Committee papers proposing unbounded-precision integer libraries for C++: N1718 (2004) and N2143 (2007), both by M.J. Kronenburg. Nothing was done with these papers, in part because there was too much else going on in the Library Working Group at the time. Now that the Committee is looking to greatly expand the scope of the standard library, it’s time to reconsider unbounded-precision integers.

N3964: Library Foundations for Asynchronous Operations, Revision 1 -- Christopher Kohlhoff

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

Date: 2014-03-02

Library Foundations for Asynchronous Operations, Revision 1

by Christopher Kohlhoff

Excerpt:

This document supersedes N3896. The term completion token is introduced to more clearly distinguish the purposes of the handler_type and async_result type traits, and a new template alias handler_type_t and template class async_completion are added. Code examples now use C++14 language facilities. Draft proposed wording is added in section 13, and a complete sample implementation is included in section 14.

N3963: Centralized Defensive-Programming Support for Narrow Contracts (Rev 4) -- J Lakos, A Zakharov

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

Date: 2014-03-02

Centralized Defensive-Programming Support for Narrow Contracts (Revision 4)

by John Lakos, Alexei Zakharov

Excerpt:

This proposal is a revision to N3877.

The standardese has been extensively redrafted based on feedback from the LWG at Issaquah.

N3962: File System TS Editor's Report, February 2014, Post-Issaquah -- 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 number: N3962

Date: 2014-03-01

File System TS Editor's Report, February 2014 - Post-Issaquah

by Beman Dawes

Excerpt:

N3940 is the latest File System TS Working Draft. It contains the changes to the File System PDTS as directed by the committee at the Issaquah meeting. Details of the changes are listed below.

N3960: Working Draft, Technical Specification for C++ Extensions for Parallelism -- Jared Hoberock

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

Date: 2014-02-28

Working Draft, Technical Specification for C++ Extensions for Parallelism

by Jared Hoberock

Excerpt:

The goal of this Technical Specification is to build widespread existing practice for parallelism in the C++ standard algorithms library. It gives advice on extensions to those vendors who wish to provide them.

N3951: C++ type reflection via variadic template expansion -- Cleiton Santoia Silva, Daniel Aures

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

Date: 2014-02-07

C++ type reflection via variadic template expansion

by Cleiton Santoia Silva and Daniel Auresco

Excerpt:

From a type T, gather member name and member type information, via variadic template expansion.

N3950: Defaulted comparison operators -- Oleg Smolsky

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

Date: 2014-02-19

Defaulted comparison operators

by Oleg Smolsky

Excerpt:

Provide means of generating default equality, inequality and comparison member operators for user-defined types. This is strictly an "opt in" feature so that semantics of existing code remain intact.