Articles & Books

Ordering by constraints--Andrzej Krzemieński

Moving to C++20!

Ordering by constraints

by Andrzej Krzemieński

From the article:

In the previous post we have seen how constraint conjunction and disjunction works, and how a function template with constraints is a better match than a function template without constraints (provided that the constraints are satisfied) when determining the best overload. We have also mentioned that selecting a better match from two constrained templates is possible, but not obvious. In this post we will expand on this, and show how constraint conjunction and disjunction as well as concepts play an important role in ordering function overloads and class template specializations based solely on constraints. This is one of the situations where language concepts show their special properties...

Nifty Fold Expression Tricks--Jonathan Müller

Many things can be done!

Nifty Fold Expression Tricks

by Jonathan Müller

From the article:

Suppose you need to have a variadic function and want to add all arguments together. Before C++17, you need two pseudo-recursive functions:

template <typename H, typename ... T>
auto add(H head, T... tail)
{
    return head + add(tail...);
}

template <typename H>
auto add(H head)
{
    return head;
}

However, C++17 added fold expressions, making it a one-liner:

template <typename H, typename ... T>
auto add(H head, T... tail)
{
    return (head + ... + tail);
    // expands to: head + tail[0] + tail[1] + ...
}

If we’re willing to abuse operator evaluation rules and fold expressions, we can do a lot more. This blog posts collects useful tricks...

The benefits and challenges of online live training -- Mateusz Pusz

Read about the benefits and challenges of online live training:

The benefits and challenges of online live training

by Mateusz Pusz

From the article:

Last week Jason Turner, Nicolai Josuttis, Rainer Grimm, Klaus Iglberger, and Mateusz Pusz met with the hosts of cpp.chat to talk about why training is valuable and to explain the particular challenges of such a profession in the days of social distancing.

Among others, C++ trainers discussed the benefits and issues with delivering the trainings and workshops in the online form. It turns out that online live training does not have to be a worse experience than participating in the face-to-face one. Read more...

 

Trip report: C++ Siberia 2020--Timur Doumler

Did you attend?

Trip report: C++ Siberia 2020

by Timur Doumler

From the article:

In 2019, I had a very busy conference year. I had just become self-employed, which meant I did not have to ask anyone’s permission anymore to go to a C++ conference. And because conferences are fun, I decided to go to all of them. Well, not all of them, but I ended up speaking at quite a few that year: CppOnSea (Folkestone), ACCU (Bristol), using std::cpp (Madrid), 4Developers (Warsaw), C++Now (Aspen), CoreC++ (Tel Aviv), C++Russia (both of them – Moscow & St. Petersburg), CppCon (Denver), ACCU Autumn (Belfast), MeetingC++ (Berlin), and finally CoreHard (Minsk). The latter one was particularly memorable because it was the first time a C++ conference invited me to deliver the opening keynote (and it was an amazing experience – thank you!)...