Articles & Books

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 @

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

Overload 145 is now available

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

Overload 145 is now available

From the journal:

Automate all the things
Automation can speed things up. Frances Buontempo considers how it can make things worse. by Frances Buontempo

How to Write a Programming Language: Part 1, The Lexer
Writing a programming language might sound very difficult. Andy Balaam starts his series with a lexer. by Andy Balaam

Type-agnostic Tracing Using {fmt}
Tracing compound and custom types is a challenge. Mike Crowe demonstrates how {fmt} provides a safe alternative to printf. by Mike Crowe

A Short Overview of Object Oriented Software Design
Object oriented design has many principles. Stanislav Kozlovski demonstrates good design through a role playing game. by Stanislav Kozlovski

Triple trip report from ACCU, C++ Russia and C++Now 2018 – Part 1—Jonathan Boccara

Were you there?

Triple trip report from ACCU, C++ Russia and C++Now 2018 – Part 1

by Jonathan Boccara

From the article:

Going to conferences is a great experience, to learn about your domain and meet people that work in it. Going to conferences can give you tools to write better code.

I’ve had the chance to go to (and speak at) three conferences over a month:

  • ACCU in Bristol, UK at the beginning of April,
  • C++ Russia in Saint-Petersburg, Russia in mid April,
  • C++Now in Aspen, US at the beginning of May.

I haven’t seen many people attending all three of them, so I figured I could make a combined trip report, to give you an idea of what they’re like. And more importantly what you would get by attending either one.

And a huge thanks to the company I work for, Murex, for sending me all over the world of C++!