Articles & Books

C++ User Group Meetings in August

Again, the overview about the upcoming user group meetings for the new month. As it is August, there are not as much meetings due to summer.

C++ User Group Meetings in August 2014

by Jens Weller

From the article:

6.8. C++ UG Austin - Pragmatic Type Erasure
13.8 C++ UG Bay area/San Francisco
14.8 C++ UG Dresden - Compile Time Sort"
14.8 C++ UG NRW/Aachen - Various talks
19.8 C++ UG Berlin - Experience with C++11 in ArangoDB
20.8 C++ UG NRW/Düsseldorf - Wartungtechniken
28.8 C++ UG Amsterdam - Event Driven Design in C++11

AST matchers and Clang refactoring tools -- Eli Bendersky

You can do some great things when you have a reusable open-source C++ parser:

AST matchers and Clang refactoring tools

by Eli Bendersky

From the article:

Clang tooling sees lots of interest and development focus in the past few years. At last, we have a convenient, accurate, open-source and well supported framework for programmatically analyzing and refactoring C++ code; I find this very exciting.

A great outcome of this rapid pace of development is that new APIs and tools spring up all the time. For example, some time ago the Clang tooling developers figured out folks doing AST traversals have to write a lot of repetitive code to find interesting AST nodes, so they came up with a great new API called AST matchers, which I want to discuss here...

Quick Q: Why doesn't std::sort accept its comparator by reference? -- StackOverflow

Quick A: By design, because function objects are expected to be nonstateful values.

Recently on SO:

Why doesn't std::sort accept comparator by reference?

The standard on std::reference_wrapper explains that std::sort now accepts std::reference_wrapper, allowing one to pass a comparator by reference.

Is there a reason std::sort didn't accept the comparator by reference in the first place?

A Clang edition of the C++11/14 Rocks book is now available

Korban's C++11/14 feature overview book now has a Clang edition, in addition to VS2013 and GCC:

Clang Edition of the C++11/14 Rocks Book

by Alex Korban

From the announcement:

Do you use Clang to compile C++? Would you like to know all about the C++11 and C++14 language features it supports?

You can read about them in the new edition of my C++11/14 Rocks book tailored to Clang.

...

For those who have the GCC edition of the book: you’ll already be familiar with all the C++11 content as GCC also has full C++11 support. However, the Clang edition has full C++14 coverage instead of an overview.

A video interview with Michael Wong

At C++Now this and last year I recorded a short interview with Michael Wong:

A video interview with Michael Wong

The interview as a youtube playlist

by Jens Weller

From the Article:

I've started last year a video interview in Aspen - while at C++Now - with Michael Wong. This year I had the chance to finish the interview and I am now finally able to release it. Michael is a member of the C++ Committee for many years, he leads the Canadian delegation and also speaks for IBM at the C++ committee.

Non-Static Data Member Initializers -- 741MHz

In case you missed it:

Non-Static Data Member Initializers

by 741MHz

From the article:

...  This problem is addressed in C++11 by allowing non-static data members to be initialized along with a declaration. For example, the following syntax is allowed:

struct foo {
    double x = 1.23;
    int y = 1;
    int z = 2;
};

This also works well with multiple constructors. The class described above could now be simplified and made easier to maintain further down the road: ...

 

Dr. Bjarne Stroustrup: An Interview -- Emyr Williams

This month's CVu carries this new interview with Bjarne Stroustrup. (Note: As CVu is subscription-only, the link is to a copy of article hosted at Stroustrup's site.)

Dr. Bjarne Stroustrup: An Interview

by Emyr Williams

From the article:

In 2013, I heard Pete Goodliffe talk about becoming a better programmer, and he lined up panel of experts about how to become a better programmer. Having heard the talk, I endeavoured to put as much of it as I could in to practice. During one of the intervals, I had a chance meeting with Bjarne Stroustrup, who was gracious enough to agree to be interviewed for my blog. I was also encouraged to publish it in the ACCU magazine, so here we are...

Inheriting Constructors in C++11 -- 741MHz

Following up on Monday's linked article:

Inheriting Constructors in C++11

by 741MHz

From the article:

Delegating Constructors [... are] extremely useful in boosting efficiency, [but] it does not solve the problem when programmer wants to create a derived class that has exactly the same set of constructor as its base class or classes. In which case programmers are forced to tediously duplicate constructors of the base class...

C++11 solves this problem by introducing constructor inheritance. In a derived class, programmers can write a single using T::T; statement that makes a derived class automatically inherit constructors of a base class. For example: ...