Articles & Books

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++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.

ISO C++ Committee – Rapperswil 2018 trip report--Timur Doumler

MAny things happened!

ISO C++ Committee – Rapperswil 2018 trip report

by Timur Doumler

From the article:

From the 4th to the 9th of June 2018, Phil Nash and I attended the ISO C++ Committee meeting in beautiful Rapperswil, Switzerland, representing JetBrains. We are continuing our active involvement in developing and standardising C++ (please read the last trip report for details)...