Trip Report: C++ Standards Meeting in San Diego, November 2018--Botond Ballo

New trip report.

Trip Report: C++ Standards Meeting in San Diego, November 2018

by Botond Ballo

From the article:

A few weeks ago I attended a meeting of the ISO C++ Standards Committee (also known as WG21) in San Diego, California. This was the third committee meeting in 2018; you can find my reports on preceding meetings here (June 2018, Rapperswil) and here (March 2018, Jacksonville), and earlier ones linked from those. These reports, particularly the Rapperswil one, provide useful context for this post...

How to Design Function Parameters That Make Interfaces Easier to Use (3/3)--Jonathan Boccara

The end.

How to Design Function Parameters That Make Interfaces Easier to Use (3/3)

by Jonathan Boccara

From the article:

This is the final article in the series about function parameters. This series contains:

  • Part 1: interface-level parameters, one-parameter functions, const parameters,
  • Part 2: calling contexts, strong types, parameters order,
  • Part 3: packing parameters, processes, levels of abstraction.

Exploring C++20 - Designated initialisers--Tobias Widlund

Will be very useful.

Exploring C++20 - Designated initialisers

by Tobias Widlund

From the article:

Compared to many other C++20 additions this one is quite small, only needing a single box of explanation on cppreference. Despite this, I quite like the feature as it helps code that uses aggregate initialisation to be more readable and less error prone - both are well needed in that area!

Quick Q: Type inference of 'auto' when using range-for loop in multidimensional arrays

Quick A: a pointer has no size information.

Recently on SO:

Type inference of 'auto' when using range-for loop in multidimensional arrays

The type of row is deduced to be int*. That means, just like any other int*, the compiler doesn't know how big the array it points to is, or even that it's a pointer to the first element of an array at all. All of that information is lost when an array decays into a pointer to its first element.

If instead you use something like

for (auto& row : ia) //<-- NOTE: row is now a reference
    for (int* j = std::begin(row); j != std::end(row); ++j)
        std::cout << *j << '\n';

then the type of row will be deduced to int (&)[4]: reference to an array of 4 ints. The length information is retained, so std::begin and std::end have the information they need.

PS: Just as a note: range-for works by using std::begin and std::end internally, so the above can be a bit more concisely written as

for (auto& row : ia)
    for (auto j : row)
        std::cout << j << '\n';

Threads are not the answer -- Lucian Radu Teodorescu

You have a performance problem, you want to employ parallelism, you start adding threads... pause a moment and reflect

Threads are not the answer

by Lucian Radu Teodorescu

From the article:

Whatever the problem is, threads are not the answer. At least, not to most software engineers.

In this post I will attack the traditional way in which we write concurrent applications (mostly in C++, but also in other languages). It’s not that concurrency it’s bad, it’s just we are doing it wrong.

The abstractions that we apply in industry to make our programs concurrent-enabled are wrong. Moreover, it seems that the way this subject is thought in universities is also wrong.

Look ma, no locks -- Lucian Radu Teodorescu

How can you solve the core problem in concurrent programming? How can you avoid using locks, but still have safety for your resources?

Look ma, no locks

by Lucian Radu Teodorescu

From the article:

We previously argued that threads are not the answer to parallelism problems, and also that we should avoid locks as much as possible. But how can we have a world in which threads do not block each other?

We want to explore here a systematic way for replacing locks (mutexes, read-write mutexes, semaphores) in our systems with tasks. We argue that there is a general schema that allows us to move from a world full of locks to a world without locks, in which the simple planning and execution of tasks makes things simpler and more efficient.

Advanced Programming in C++ (Spanish) in Madrid -- Daniel Garcia

This course is offered in Spanish (might be available in English on demand).

Advanced Programming in C++

by Daniel Garcia

About the course:

The course is a 3 full-days training (24 hours) covering C++11, C++14, and an introduction to C++17 at March 25th, 26th, 27th, 2019 in Madrid. It is structured in 4 modules:

  • Language (Generalities and type system, Initialization, classes, global novelties, generic programming support).
  • Standards library (Metaprogramming support, utilities, STL, strings).
  • Concurrency (Introduction to concurrency, memory model, threads, mutual exclusion, futures and promises).
  • Introduction to C++17

About the trainer:

J. Daniel Garcia is an Associate Professor in Computer Architecture at University Carlos III of Madrid, Spain. He has extensive experience in industrial project in domains ranging from aerospace and civil engineering to medical technology and finance.

Since 2008 he has served as a member of WG21 (C++ standards committee) as well as chair of the Spanish committee on C++. He has co-authored a number of proposals for C++, since C++11. His main efforts for C++20 are related to the introduction of contracts programming.

Announcing Live Share for C++: Real-Time Sharing and Collaboration

VS2019 preview 1 is available and comes with a number of new C++ features, including Live Share for collaborative coding.

Announcing Live Share for C++: Real-Time Sharing and Collaboration

By Nick Uhlenhuth

From the article:

C++ developers using Visual Studio 2019 16.0 Preview 1 or Visual Studio Code can now use Live Share. With Live Share you can share the full context of your code, enabling collaborative editing and debugging.

Exploring Clang Tooling – Using Build Tools with clang-tidy--Stephen Kelly

Today about clang-tidy.

Exploring Clang Tooling – Using Build Tools with clang-tidy

by Stephen Kelly

From the article:

The previous series about clang-tidy on this blog covered the basics of creating a clang-tidy extension and tooling to support that in the form of clang-query.

While the series focused on single-file examples for simplicity, developers progressing in this direction will need to run the tooling on all of the files in their project at once, or on all files which match a specific pattern.