C++20 STL Features: 1 Year of Development on GitHub

C++20 STL Features: 1 Year of Development on GitHub

My CppCon 2020 talk, “C++20 STL Features: 1 Year of Development on GitHub”, is now available on YouTube. The slides are available on GitHub as PDF and original PPTX.

My CppCon 2020 talk, “C++20 STL Features: 1 Year of Development on GitHub”, is now available on YouTube. The slides are available on GitHub as PDF and original PPTX.

The talk contains complete examples (not snippets!) of several C++20 features: integer comparison functions, constexpr algorithms, uniform container erasure, atomic_ref, and span.

Here are the important links from the end of the talk:

Finally, at the end of the talk I had time to answer a half-dozen questions, but there were many more. Here are those extra questions and my answers:

Q: Why do you squash pull requests instead of just merging them?

A: This significantly simplifies the branch’s history, since one squashed commit == one PR. You can still view the PR’s history on GitHub. Merges would create highly non-linear history (making it hard to figure out when things changed and why; the MSVC internal git repo is full of non-linear merges so we have unfortunate extensive experience with that). Most of the information from non-squashed merges would be uninteresting too – basically code review feedback, fixing bugs during development, etc. For highly unusual situations I could imagine wanting to sequence a PR as a series of commits that are then rebased-and-merged to the default branch, which we’d need to temporarily enable via policy, but generally having that history in the PR is sufficient.

Q: Regarding the atomic_ref, why not just specify relaxed access when you don’t want to pay the atomic penalty?

A: My understanding is that relaxed is still significantly more expensive than plain operations. For example, on x86/x64 for MSVC, atomic increments are implemented by _InterlockedIncrement which provides full sequential consistency, even if you asked for relaxed; I’ve heard that this costs somewhere around 10-100 cycles, whereas a plain increment is half a cycle or less. Even on ARM/ARM64, where there are _Meow_nf intrinsics (“no fence”) for relaxed, I believe they still imply additional costs compared to plain logic.

c++

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Dicey Issues in C/C++

C/C++ problems. If you are familiar with C/C++then you must have come across some unusual things and if you haven’t, then you are about to. The below codes are checked twice before adding, so feel free to share this article with your friends.

Loops in C++ | For, While, and Do While Loops in C++

In this Video We are going to see how to use Loops in C++. We will see How to use For, While, and Do While Loops in C++.

Using isdigit() in C/C++

In this article, we'll take a look at using the isdigit() function in C/C++. This is a very simple way to check if any value is a digit or not. Let's look

Object Oriented Programming in C++ | C++ OOPs Concepts | Learn Object Oriented C++

C++ is general purpose, compiled, object-oriented programming language and its concepts served as the basis for several other languages such as Java, Python, Ruby, Perl etc.

A Complete Guide to fread() in C/C++

In this article, we’ll take a look at using fread() in C/C++.