Articles & Books

The Tightly-constrained Design Space of Convenient Syntaxes For Generic Programming—Corentin Jabot

An exploration of the various convenient syntaxes for declaring templates and function templates as proposed C++20:

The tightly-constrained design space of convenient syntaxes for generic programming

by Corentin Jabot

About the article:

Did you know that the Concept TS was merged into the Working Draft in July 2017, in Toronto? And we are a Planck length away from merging the Range TS in C++20 as well, including a few goodies such as projections, contiguous ranges/iterators and ranges adaptors? We also added a bunch of general-purpose concepts in the std namespace in Rapperswil.

Concepts have been 3 decades in the making and the Ranges TS is a huge body of work. Yet, I feel like a lot of people are unaware of these great features that are coming to a compiler near them.

Examples of Parallel Algorithms From C++17—Bartlomiej Filipek

Do you know them?

Examples of Parallel Algorithms From C++17

by Bartlomiej Filipek

From the article:

MSVC (VS 2017 15.7, end of June 2018) is as far as I know the only major compiler/STL implementation that has parallel algorithms. Not everything is done, but you can use a lot of algorithms and apply std::execution::par on them!

Have a look at few examples I managed to run...

Modern C++ for C programmers—bert hubert

In 2018, C++ is a modern programming language that C programmers may want to take another look at, especially if they are pondering shifting to Go or Rust.

Modern C++ for C programmers part 1

Modern C++ for C programmers part 2

by Bert Hubert

From the article:

In this and subsequent posts, I hope to convince C programmers to give ‘2017 era C++’ (which is entirely unlike 2003 C++) another good look. To do so, I want to show that within C++ hides a simple language that still offers you many good things without immediately requiring you to tackle all 1400 pages of ‘The C++ Programming Language’. In other words, I claim there is great benefit already when only using a judicious selection of the best parts of C++.

My goal is that when you go look for a new language to learn (say, Go or Rust), you will hopefully consider modern C++ as well

 

C++20 features described in Before/After tables (“Tony Tables”)—Tony Van Eerd

Useful to keep an eye on the evolution.

C++20 features described in Before/After tables ("Tony Tables")

by Tony Van Eerd

From the article:

C++20 features described in Before/After tables ("Tony Tables")

This is an attempt to succinctly describe the main (not all) features of C++20, and to update these docs as features are moved through the committee...

C++17: Attributes—Marc Gregoire

Another new feature.

C++17: Attributes

by Marc Gregoire

From the article:

C++17 introduces three new code attributes:

  • [[fallthrough]]
  • [[maybe_unused]]
  • [[nodiscard]]

The first one was discussed in detail in my C++17: Fallthrough in switch statements blog post. The others are briefly explains below...

C++ rvalue references and move semantics for beginners

A collection of personal notes and thoughts on rvalue references, their role in move semantics and how they can significantly increase the performance of your applications.

C++ rvalue references and move semantics for beginners

by Triangles @ internalpointers.com

From the article:

In my previous article Understanding the meaning of lvalues and rvalues in C++ I had the chance to explain to myself the logic behind rvalues. The core idea is that in C++ you will find such temporary, short-lived values that you cannot alter in any way.

Surprisingly, modern C++ (C++0x and greater) has introduced rvalue references: a new type that can bind to temporary objects, giving you the ability to modify them. Why?

Quick Q: Accessing protected members in a derived class

Quick A: Only your own type can be accessed.

Recently on SO:

Accessing protected members in a derived class

You can only access protected members in instances of your type (or derived from your type).
You cannot access protected members of an instance of a parent or cousin type.

In your case, the Derived class can only access the b member of a Derived instance, not of a different Base instance.

Changing the constructor to take a Derived instance will also solve the problem.