Articles & Books

Mutable--Arne Mertz

Do you know that keyword?

Mutable

by Arne Mertz

From the article:

The mutable keyword seems to be one of the less known corners of C++. Yet it can be very useful, or even unavoidable if you want to write const-correct code or lambdas that change their state...

Quick Q: Why would one use nested classes in C++?

Quick A: To hide implementation details

Recently on SO:

Why would one use nested classes in C++?

Nested classes are cool for hiding implementation details

List:

class List
{
    public:
        List(): head(NULL), tail(NULL) {}
    private:
        class Node
        {
              public:
                  int   data;
                  Node* next;
                  Node* prev;
        };
    private:
        Node*     head;
        Node*     tail;
};

Here I don't want to expose Node as other people may decide to use the class and that would hinder me from updating my class as anything exposed is part of the public API and must be maintained forever. By making the class private, I not only hide the implementation I am also saying this is mine and I may change it at any time so you can not use it.

Look at std::list or std::map they all contain hidden classes (or do they?). The point is they may or may not, but because the implementation is private and hidden the builders of the STL were able to update the code without affecting how you used the code, or leaving a lot of old baggage laying around the STL because they need to maintain backwards compatibility with some fool who decided they wanted to use the Node class that was hidden inside <list>.

Overload 141 is now available -- ACCU

ACCU’s Overload journal of October 2017 is out. It contains the following C++ related articles.

Overload 141

From the index:

'Speedy Gonzales' Serializing (Re)Actors via Allocators

Polymorphism in C++ - A Type Compatibility View

Open Source - And Still Deceiving Programmers

C++11 (and Beyond) Exception Support

C++17--Egor Bredikhin

A reminder of what C++17 bring:

C++17

by Egor Bredikhin

From the article:

C++ language is constantly evolving, and for us, as for developers of a static analyzer, it is important to track all its changes, in order to support all new features of the language. In this review article, I would like to share with the reader the most interesting innovations introduced in C++17, and demonstrate them with examples.

Most interesting innovations in C++17

C++ language is constantly evolving, and for us, as for developers of a static analyzer, it is important to track all its changes, in order to support all new features of the language.

Most interesting innovations in C++17

by Egor Bredikhin

From the article:

Fold expressions, template<auto>, constexpr if, constexpr lambdas, *this capture in lambda expressions, inline variables, structured bindings, __has_include, std: byte type and so on.

 

CppCon 2017 Trip Report--Isabella Muerte

Yet another interesting report!

CppCon 2017 Trip Report

by Isabella Muerte

From the article:

It's been a few days since I got back from CppCon 2017. As a millenial, I easily cave to peer pressure and because everybody else is doing it, I figured I might as well write a trip report too.

My CppCon 2017 Trip Report – 10 great talks to watch and learn from--Quentin Duval

Yet another trip report.

My CppCon 2017 Trip Report – 10 great talks to watch and learn from

by Quentin Duval

From the article:

The last edition of the CppCon 2017 just ended. As for the previous edition, it was a real pleasure to be there, discussing with talented and curious fellow developers, and watching great talks. In particular, I got the feel that the conference offered more diverse talks than the previous edition...