Articles & Books

Thoughts About C++17 -- Bjarne Stroustrup

We normally wait until committee papers get "N" (permanent) numbers, but this one is an exception. It has also already been circulated to ISO C++ committee members in preparation for the next ISO C++ meeting that begins on Monday in Lenexa, Kansas, USA.

D4492: Thoughts About C++17

by Bjarne Stroustrup

From the paper:

This is a draft intended to focus a discussion at the Lexena committee meeting.

This is an extended version (based on feedback) of an internal committee standard reflector message that got so widely distributed and discussed that it would be a good idea to have it as a document. I have tried to remove distracting committee jargon. Thanks to people who took part in the reflector discussion or commented on the web. I have also added links. It is still a collection of thoughts aimed at stimulating a discussion, rather than a formal paper or a precise proposal.

The note was written for committee members, but “escaped into the wild.” Here are a few comments from the web: [Reddit] [The Register] [Hacker News]

As you see, people outside the committee also have strong opinions. Those opinions can depart radically from the ones I hear in the committee and from reality.

I am often asked “what will C++17 be?” and variations of “What will C++17 do for me?” ... [continue reading]

A clever comment style--Andrzej Krzemieński

You will find here a solution to link a comment to its code:

A clever comment style

by Andrzej Krzemieński

From the article:

Comments are one of the most useful language features; in practically any programming language. Yet, they can become really a pain...

Tippet: Use reference_wrapper to create views of data -- Indi

Explicit C++ describes how to use std::reference_wrapper to create alternative views of data.

Tippet: Use reference_wrapper to create views of data

by Indi

from the article:

When working with objects indirectly, always use references. Only use pointers to indicate optional referencing. But there’s one little hitch: because you can’t rebind references, you can’t simply have a container of references. Enter std::reference_wrapper.

The C++ highlights and more of GCC 5.1

The release of GCC 5.1 is a highlight, here is an overview on the most important new things:

The C++ highlights of GCC 5.1 and more

by Jens Weller

From the article:

Just recently, GCC 5.0 has been released as GCC5.1, the not only the newest version of GCC, but also bumping up the version number from 4 to 5. This release is a major milestone for GCC, but also for C++, as it brings full C++14 support, but yet not C++11(std=c++11) as the new default...

Coupling and Cohesion -- Paul Watt

coupling-lego.PNGA solid and entertaining treatment with good C++ examples:

Coupling and Cohesion

by Paul Watt

From the middle of the article:

... To further clarify this statement, not all code should be reused.

Why Not?

Because the majority of software that is written is designed to fulfill a very specific purpose. The challenge is to find the balance point between generic reusable building blocks, and a tool or application that meets a need. Generic software components are very valuable, however, they are almost useless by themselves...

And gems like this:

... For every statement of code that you write or use, you should ask the question: Does this add value or risk?

Don't blame initializer_list prematurely -- Marco Arena

A post on three common pitfalls regarding initializer_list...or not? 

Don't blame initializer_list prematurely

by Marco Arena

From the article:

“Cannot convert initializer list argument to ‘int*'”. People started trying to figure out why initializer_list was not covertible to int[]. [...] A gentleman spotted the following in the dark corners of the codebase:

vector<YahtzeeGame> games;
games.push_back(make_tuple(5, 6, 2));
games.push_back(make_tuple(5, 6, 3));
games.push_back(make_tuple(5, 6, 4));
// other stuff

Excited about C++11, he tried to refactor:

vector<YahtzeeGame> games = { {5, 6, 2}, {5, 6, 3}, {5, 6, 4} };
And does it compile? ...

Regular expression in c++11/14 -- GuoJiufu

Overview on Regular Expression Support in Modern C++.

   Regular expression in c++11/14

   by GuoJiufu

From the article:

Regular expression is a useful string process utility for handling both pure text and markup language text like html. There are a few useful tools that are designed to use regular expression, such as  grep and sed. In development language, most script languages, for example, javascript or perl, support regular expression. Regular expression has also been introduced into java as module for a long time. In C, the most famous regular expression library among many of those libraries developed would be POSIX regular expression API. As for C++, boost regular expression library was developed a few years ago. Then in C++11, regular expression was introduced into the standard library as <regex>.  This blog is going to explain what is regular expression and how it is supported in c++11/14.

boost 1.58 - a short overview -- Jens Weller

Short overview on the new libraries introduced in boost 1.58.

   boost 1.58 - a short overview

   by Jens Weller

From the article:

A new version of boost has been released, version 1.58 brings two new libraries and a lot of bug fixes (fixes for 28 libraries are listed). Also, a good resource for boost is the new and updated book about the boost libraries from Boris Schäling, which is also available online. Not included in this release is boost.compute, a library earlier this year accepted into boost and presented at C++Now, maybe it will be in 1.59 later this year.