News

Optimizing C++ Code with O(1) Operations -- Giovanni Dicanio

Continuing from the previous Adventures with string_view post, in this new article I show how you can achieve massive performance gains using code characterized by O(1) constant-time asymptotic complexity.

Adventures with string_view: Optimizing Code with O(1) Operations

by Giovanni Dicanio

From the article:

While this code works fine, it’s possible to optimize it.

As the saying goes, first make things work, then make things fast.

Replacing a O(N) operation with a O(1) operation in this case gives a performance boost of 88 ms vs. 445 ms, which is an 80% performance gain!

 

C++20 Coroutines back to basics — Restrictions and rules for legal coroutines--Gajendra Gulgulia

Surprising but useful.

C++20 Coroutines back to basics — Restrictions and rules for legal coroutines

by Gajendra Gulgulia

From the article:

In my previous articles on coroutines, I attempted to explain the mechanics of coroutine suspension, resuming it, promise_type, awaiters and awaitables. In this article, I would like to answer two very basic questions:

  • What are the restrictions on coroutines ?
  • When can a coroutine usage be legal in terms of member, non-member functions of class/structs, lambda expressions and so on ?

Call for talks for Meeting C++ 2022

The official call for talks for this years Meeting C++ conference. To promote this years call for talks, Meeting C++ online organizes an event about technical speaking for C++. On May 24th 8 great speakers will share some of the aspects on preparing and giving talks with you...

Call for talks for Meeting C++ 2022

by Jens Weller

From the article:

In begin of April Meeting C++ 2022 was announced, and since then also the call for talks is technically running and a first set of interesting talks has been submitted.

As Meeting C++ 2022 is a hybrid conference, taking place online and in Berlin. Likely the bigger audience will be online, and speakers are expected to be ready to give their talk online. You can submit and edit your talk until June 12th.

Local Time--Andrzej Krzemieński

Correct time tables.

Local Time

by Andrzej Krzemieński

From the article:

In this post we will see how to solve the task from the previous post, but display the time point in local time instead of system time. The solution is simple and takes only two additional lines (you can scroll down towards the end), but I want to take this opportunity to offer some reflections about the concepts of time zones and daylight saving time...

New C++ features in GCC 12--Marek Polacek

Time to update.

New C++ features in GCC 12

by Marek Polacek

From the article:

Version 12.1 of the GNU Compiler Collection (GCC) is expected to be released in April 2022. Like every major GCC release, this version will bring many additions, improvements, bug fixes, and new features. GCC 12 is already the system compiler in Fedora 36. GCC 12 will also be available on Red Hat Enterprise Linux in the Red Hat Developer Toolset (version 7) or the Red Hat GCC Toolset (version 8 and 9).

Like the article I wrote about GCC 10, this article describes only new features affecting C++.

We implemented several C++23 proposals in GCC 12. The default dialect in GCC 12 is -std=gnu++17; to enable C++23 features, use the -std=c++23 or -std=gnu++23 command-line options. (The latter option allows GNU extensions.)

Note that C++20 and C++23 features are still experimental in GCC 12...