June 2021

Reversing words of a string with ranges--Marco Arena

A new interpretation of a classical problem:

Reversing words of a string with ranges

by Marco Arena

From the article:

In this post I share the story of a “C++ aha-moment”, hence I use the hashtag #thatsarotate (resumed last Saturday at the Italian C++ Conference 2021 to honor our keynote speaker Sean Parent). Why not sharing your own stories of “C++ aha-moments” adding the same hashtag to your tweets, posts, or whatever? It would be really appreciated...

7 Top Tips for Debugging C++ -- Greg Law

In this guest blog post, Greg will share a few top tips for debugging C++ code.

7 Top Tips for Debugging C++

by Greg Law

From the article:

Debugging is central to programming – you cannot be a great programmer without being great at debugging. Hopefully, my favorite C++ debugging tips will help you be as clever and productive debugging your code as you are writing it in the first place.

  • #1 Have a full kit of debugging tools
  • #2 Conditional breakpoints
  • #3 Watchpoints
  • #4 User-defined debugging commands in Python
  • #5 Pretty-print structures
  • #6 Time Travel Debugging
  • #7 Command find to search for a byte sequence

Transrangers: An Efficient, Composable Design Pattern for Range Processing -- Joaquín M López Muñoz

Another twist on ranges.

Transrangers: An Efficient, Composable Design Pattern for Range Processing

by Joaquín M López Muñoz

From the article:

Transrangers are a new design pattern for efficient, composable range processing that can be faster than pull-based C++/Range-v3 views whithout losing any expressiveness. The underlying architecture combines ideas from push processing with the internalization of control flow. Transrangers can be used on their own or be leveraged as an implementation detail of range libraries to improve the performance of view-based operations.


C++ on Sea on Video

In collaboration with Digital Medium, we've produced a video to showcase this year's event (ok, it was mostly Digital Medium, with some input from us)!

C++ on Sea on Video


CopperSpice: char8_t

New video on the CopperSpice YouTube Channel:


by Barbara Geller and Ansel Sermersheim

About the video:

In this video we look at the new definition of char8_t in C++20. Since most developers use strings in their code, this is a big deal. This change caused a cascade and a ripple effect. Our video explains the controversy, confusion, and how your code will be affected.

Please take a look and remember to subscribe!

Painless C++ Coroutines--Gajendra Gulgulia

Another introduction.

Painless C++ Coroutines-Part 1

Painless C++ Coroutines-Part 2

Painless C++ Coroutines-Part 3

Painless C++ Coroutines-Part 4

Painless C++ Coroutines-Part 5

by Gajendra Gulgulia

From the article:

Incidentally I found the mechanics of coroutines quite obfuscating given the number of implicit and under-the-hood calls to several methods associated with coroutine and their return type objects. Even with tons of articles and posts on the web, I started to have a feeling that coroutines is an arcane feature that can be understood by the very few who are either in committee or are renowned authors of blogs, books and articles or experienced C++ library authors.
But after a month of arduous efforts and experiments, trials and errors to understand coroutine, I decided to write a tutorial series that can be used by any intermediate C++ developer to understand coroutine and in the effort I made sure that this article is the last that anyone should refer to, to learn, understand and demystify coroutines without being a super experienced C++ library author. If you’re impatient to get started, then directly jump to section 1: What are coroutines? Else read the Introduction section to get detailed highlight of the tutorial series...

Template Arguments--Rainer Grimm

The series continue.

Template Arguments

by Rainer Grimm

From the article:

It is quite interesting how the compiler deduces the types for the template arguments. To make it short, you get most of the time the type you expect. The rules do not only apply to function templates (C++98) but also to auto (C++11), to class templates (C++17), and concepts (C++20)...

in Visual Studio 2019 version 16.10--Charlie Barto

Ready to be used.

<format> in Visual Studio 2019 version 16.10

by Charlie Barto

From the article:

C++20 adds a new text formatting facility to the standard library, designed primarily to replace snprintf and friends with a fast and type safe interface. The standardized library is based on the existing {fmt} library, so users of that library will feel at home.

Before diving into how std::format works I want to thank Victor Zverovich, Elnar Dakeshov, Casey Carter, and miscco, all of whom made substantial contributions to this feature, and were the reason why we could complete it so quickly...