advanced

The Most Vexing Parse: How to Spot It and Fix It Quickly--Jonathan Boccara

Did you have that problem?

The Most Vexing Parse: How to Spot It and Fix It Quickly

by Jonathan Boccara

From the article:

Everyone has their little defaults. You know, that little something that they do from time to time and that gets on your nerves, even though they’re otherwise nice people?

For C++, one of these little annoyances is the most vexing parse, well, as its name suggests...

C++ Comma Operator--Ivan Sanz

It needs to be used carefully, but has its uses.

C++ Comma Operator

by Ivan Sanz

From the article:

Comma operator has been with us for a long time. First seen in C spec and improved with custom overloads in C++, it quickly became one of those hidden things you shouldn’t use.
Most C/C++ books avoid speaking about goto the same way they do about comma operator. This is not fair, as both of them can be used properly on certain cases. Let’s speak about that...

C++ Weekly Episode 96: Transparent Lambda Comparators—Jason Turner

Episode 96 of C++ Weekly.

Transparent Lambda Comparators

by Jason Turner

About the show:

In this episode Jason explores the use of lambdas as comparators for the associative containers. Just how far can we take the use of lambdas? Variadic templates, forwarding references, multiple inheritance, variadic "using" declarations, local classes, transparent comparators and direct base class initialization are all utilized in this video.

Red Hat at the ISO C++ Standards Meeting (Nov 2017): Parallelism and Concurrency -- Torvald Riegel

Discover how C++ evolves:

Red Hat at the ISO C++ Standards Meeting (November 2017): Parallelism and Concurrency

by Torvald Riegel

From the article:

Several Red Hat engineers attended the JTC1/SC22/WG21 C++ Standards Committee meetings in November 2017. This post focuses on the sessions of SG1, the study group on parallelism and concurrency. SG1 had a full schedule as usual, with Executors, Futures, and deferred reclamation mechanisms (e.g., RCU) being major discussion topics. We also started to track the state of proposals and topics we will need to discuss in a publicly accessible bug tracker...

Your own type predicate--Andrzej Krzemieński

A very detailled and complete article to start playing with template predicates!

Your own type predicate

by Andrzej Krzemieński

From the article:

In this post we will see how to define a type trait or a type predicate or a meta-function that would allow us to check at compile time whether a type exposes an interface that we need. That is, we want to check if a given type T has:

  • nested typename result_type,
  • static member function set_limit that takes one argument of type int,
  • member function get_result that returns type const result_type& and that is declared not to throw exceptions...