April 2017

C++ Jobs and Predictions—Bartlomiej Filipek

Is C++ job market falling or growing? Since billions of lines of code are already written it's not possible to disappear in a second. So what's the current state and the future?

C++ Jobs and Predictions

by Bartlomiej Filipek

From the article:

... if you like this area you'll be able to find a C++ job anyway. I hope C++20 will add another good reason to stick with C++ and even move from other languages... but we need to wait a few years to see it happening.

Understand ranges better with the new Cartesian Product adaptor—Jonathan Boccara

The future explained:

Understand ranges better with the new Cartesian Product adaptor

by Jonathan Boccara

From the article:

A couple of days ago, the range-v3 library got a new component: the view::cartesian_product adaptor.

Understanding what this component does, and the thought process that went through its creation is easy and will let you have a better grasp of the range library. (Note that you could just as well understand all the following by looking at the zip adaptor. But cartesian_product is brand new, so let’s discover this one, in order to hit two birds with one stone)...

An Introduction to Reflection in C++—Jackie Kay

What's the status of reflection in C++?

An Introduction to Reflection in C++

by Jackie Kay

From the article:

Stop me if you’ve heard this one before. You are working on a messaging middleware, a game engine, a UI library, or any other large software project that has to deal with an ever-growing, ever-changing number of objects. These objects have many different qualities but can be grouped by their functionality: they can be sent across the network or collided with or rendered.

Because you are a good programmer who believes in the DRY principle, you want to write the “action” code that does the stuff on these objects without repetition, and plug in specific Message types or Renderable types into your generic pipeline at the appropriate places. It would be really nice to compose objects hierarchally: for example, if I had a widget class composed of several different renderable Rectangles, I want to be able to automatically generate the rendering code for my widget based on the existing rendering logic for its constituent shapes...

Final Classes—Arne Mertz

Some thoughts about final classes.

Final Classes

by Arne Mertz

From the article:

A few days ago, a colleague asked me if it was wise to make every class a final class. Here is a more sophisticated answer than I could give at that time...

Slides of the 11th of April 2017 BeCPP Meeting—Marc Gregoire

BeCPP_Logo_282x64.pngOn 11th of April 2017, the Belgian C++ Users Group had their next event sponsored by SoftKinetic.

Slides of the 11th of April 2017 BeCPP Meeting

The presentations:

  • "Challenges in Modern Embedded Development Using C++" (Glyn Matthews)
  • "SFINAE and type traits: In the Mix" (Lieven de ####)

If you couldn’t attend the event in person, or if you would like to go over the material again, you can download them from the BeCPP website.

CppCast Episode 97: Vcsn with Akim Demaille

Episode 97 of CppCast the only podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Akim Demaille to discuss VCSN, a platform for automata and rational expressions, and some of the interesting problems he faced while working on the library.

CppCast Episode 97: Vcsn with Akim Demaille

by Rob Irving and Jason Turner

About the interviewee:

Akim has been participating in free software for about 20 years, starting with a2ps, an anything to PostScript tool written in C. In order to ensure its portability, he became a major contributor to GNU Autoconf, GNU Automake and GNU Bison.

Akim has been teaching and researching at EPITA, a French CS Graduate School, for eighteen years. He has taught formal languages, logics, OO design, C++ and compiler constructions, which includes the Tiger compiler, an educational project where students implement a compiler in C++. This project, whose assignment is regularly updated, keeps track of the C++ eveolutions, and this year's version uses C++17 features.

Akim's recent research interests are focused on the Vcsn platform, dedicated to automata and rational expressions.

He's recently been recruited by former students of his to be part of the Infinit team at Docker.

Quick Q: std::move with std::shared_ptr in lambda

Quick A: Lambda captures are const by default, and it is not possible to move a const.

Recently on SO:

std::move with std::shared_ptr in lambda

The captured variable ptr in a lambda is by default const, i.e. the type of ptr is const std::shared_ptr<int>.

std::move cannot move out const objects, so a copy is created instead.

If you really want to move it, the ptr must be allowed to be mutable:

auto lambda = [ptr]() mutable {

Quick Q: Are the experimental features of modern C++ reliable for long-term projects?

Quick A: No

Recently on SO:

Are the experimental features of modern C++ reliable for long-term projects?

Is it guaranteed that all compliant compilers have the same experimental features?
No, experimental features are optional.
Are experimental features prone to big changes that make them unreliable?
Yes, the C++ committee might even decide to abandon a feature or in the process of standardization a defect might come up that would force a feature to change.

Generally, it's not a good idea to depend on experimental features. Experimental features are exactly what the word says (i.e., to experiment with).

Disabling narrowing conversions in signal/slot connections—Giuseppe D’Angelo

A new useful feature in Qt:

Disabling narrowing conversions in signal/slot connections

by Giuseppe D'Angelo

From the article:

A small new feature that I have added to Qt 5.8 is the possibility of disabling narrowing conversions in the new-style QObject::connect statement. In this short blog post I would like to share with you why I thought this was useful and therefore implemented it...