Articles & Books

C++ Coroutines: Understanding operator co_await--Lewis Baker

An article very complete!

C++ Coroutines: Understanding operator co_await

by Lewis Baker

From the article:

In the previous post on Coroutine Theory I described the high-level differences between functions and coroutines but without going into any detail on syntax and semantics of coroutines as described by the C++ Coroutines TS (N4680).

The key new facility that the Coroutines TS adds to the C++ language is the ability to suspend a coroutine, allowing it to be later resumed. The mechanism the TS provides for doing this is via the new co_await operator.

Understanding how the co_await operator works can help to demystify the behaviour of coroutines and how they are suspended and resumed. In this post I will be explaining the mechanics of the co_await operator and introduce the related Awaitable and Awaiter type concepts.

But before I dive into co_await I want to give a brief overview of the Coroutines TS to provide some context...

code::dive Trip Report

Adi Shavit reports from the recent code::dive conference

code::dive Trip Report

by Adi Shavit

From the article:

The code::dive conference took place last week in Poland at the beautiful city of Wrocław (pronounced VROWTS-WAF). I had seen excellent videos of talks from previous years and this year promised a roster of distinguished speakers.
I had never been to a C++ conference before and beyond the talks I was looking forward to meeting face-to-face many of my online Slack, Twitter and GitHub friends, followers and followees, as well as many of the speakers whose work I’ve been following online through blogs, repos and videos.

Machine Learning with C++ -- Gareth Richards

Learning about Machine learning with C++.

Machine Learning with C++

by Gareth Richards

From the article:

An introduction to Machine learning demonstrating a how to write a short C++ library which can recognize handwritten digits and implements the standard learning algorithm for neural networks, known as stochastic gradient descent.

 

 

How to Use the STL With Legacy Output Collections--Jonathan Boccara

And how back_inserter works.

How to Use the STL With Legacy Output Collections

by Jonathan Boccara

From the article:

When you start using the STL and its algorithms in your code, it’s a bit of a change of habits. And then after a while you get used to it. Then it becomes a second nature. And then even your dreams become organized into beautifully structured ranges that fly in and out of well-oiled algorithms.

And when you reach that point, there is no coming back.

Until the day you come upon an old legacy structure that won’t let itself approached by the elegant and expressive way of coding that STL algorithms have. It’s a terrible encounter, where the beast tries to suck you back into the lengthy and dangerous quicksand of the raw for loops that now seemed so far away...

Trip Report: C++ Standards Meeting in Albuquerque, November 2017--Botond Ballo

A thorough and detailed summary of the recent six-day meeting.

Trip Report: C++ Standards Meeting in Albuquerque, November 2017

by Botond Ballo

From the article:

A couple of weeks ago I attended a meeting of the ISO C++ Standards Committee (also known as WG21) in Albuquerque, New Mexico. This was the third committee meeting in 2017; you can find my reports on previous meetings here (February 2017, Kona) and here (July 2017, Toronto). These reports, particularly the Toronto one, provide useful context for this post.

With the final C++17 International Standard (IS) having been voted for publication, this meeting was focused on C++20, and the various Technical Specifications (TS) we have in flight, most notably Modules...

Simplifying Compile-Time Options With if constexpr--Philippe Groarke

New possibilities open in front of us!

Simplifying Compile-Time Options With if constexpr

by Philippe Groarke

From the article:

My latest little experiment relates to compile-time options and eliminating preprocessor checks in user code. I’m not a big fan of MACROs, especially when they are simply used to make compile-time branches. I am also not a fan of other techniques used to minimize this problem. With C++17, we now have a beautiful and simple tool that can help remove all these preprocessor checks, if constexpr...

Implementing the spaceship operator for optional--Barry Revzin

The future implementation?

Implementing the spaceship operator for optional

by Barry Revzin

From the article:

Last week, the C++ Standards Committee added operator<=>, known as the spaceship operator, to the working draft for what will eventually become C++20. This is an exciting new language feature for two reasons: it allows you to write one function to do all your comparisons where you used to have to write six, and it also allows you to write zero functions — just declare the operator as defaulted and the compiler will do all the work for you! Exciting times...

First Meeting C++ Trip Report -- Simon Brand

Simon Brand attended the recent Meeting C++ conference and wrote down his impressions:

Meeting C++ Trip Report

by Simon Brand

From the article:

This year was my first time at Meeting C++. It was also the first time I gave a full-length talk at a conference. But most of all it was a wonderful experience filled with smart, friendly people and excellent talks. This is my report on the experience. I hope it gives you an idea of some talks to watch when they’re up on YouTube, and maybe convince you to go along and submit talks next year! I’ll be filling out links to the talks as they go online.

 

CppCon2017 Trip Report -- Gordon Brown

Trip report from CppCon 2017. Highlights, trends and some tips for getting the most out of the conference.

CppCon2017 Trip Report

by Gordon Brown

From the article:

CppCon this year was bigger than ever with approaching 1200 attendees and 7 tracks; making it even harder to pick which talks to go to. Thankfully all the talks are made available online, so if you couldn’t make it to the conference or even if you did but couldn’t get to see all the talks you wanted to, you can go online and watch them. I only got to a handful of the talks as I often had conflicting appointments, but I’ve highlighted a few from what I saw that I would recommend checking out and some which I didn’t make it to but heard good things about.