Blog

Semantic requirements in concepts

More concepts.

Semantic requirements in concepts

by Andrzej Krzemieński

From the article:

The word ‘concept’ in the context of C++ generic programming has two meanings. The first is more abstract: it is the notion from the domain of Generic Programming (GP) in general. GP is not tied to any specific language: it is an approach to writing programs, and concepts are part of this approach. In this sense concepts have been with us since the inception of the STL. The second meaning is the keyword concept in C++20 with its associated semantics: its goal is to approximate the more abstract notion of a concept from GP, and this works only to some extent. One notable difference is that concepts in GP specify semantic requirements on types they constrain, and C++ concepts cannot express them directly.

In this post we will see how semantic requirements in concepts can break your program if you don’t pay attention to them, and what can be done in C++20 concepts to account for semantic requirements...

Tricks with Default Template Arguments--Jonathan Müller

Did you know?

Tricks with Default Template Arguments

by Jonathan Müller

From the article:

Just like regular function parameters, template parameters can also have default parameters. For class templates, this behaves mostly just like default function arguments: if you pass fewer template arguments than required, default template arguments are used to fill the remaining places. However, for function templates, it gets more complicated as template parameters for functions can be deduced by the normal function arguments. This leads to some interesting side-effects. In particular, default arguments of template parameters don’t need to be put at the end!

Let’s take a look at a couple of things we can do with default template arguments...

Jason Turner and Rob Irving join Meeting C++ 2020 for an shared AMA

The 3rd and last AMA planned for Meeting C++ 2020 is with Jason Turner and Rob Irving!

Jason Turner and Rob Irving join Meeting C++ 2020 for an shared AMA

by Jens Weller

From the article:

Jason and Rob are well known for being the Hosts of CppCast, but also have a live beyond this in the tech world. Jason is well known for his C++ weekly and recently published a book about C++ best practices. While Rob is an experienced software developer and team lead with a strong focus on C++, but also knows C#, Objective C, Java and Ruby.

Checking Clang 11 with PVS-Studio

It's no secret that compilers employ their own built-in static code analyzers, and those are developing as well. That's why we write articles every now and then to show that our static analyzer, PVS-Studio, can find bugs even inside compilers and that we are worth our salt.

Checking Clang 11 with PVS-Studio

by Andrey Karpov

From the article:

The programmer is using a modulo operation to get a random value of either 0 or 1. But the value 1 seems to confuse developers and make them write the classic anti-pattern in which the modulo operation is performed on 1 instead of 2. The X % 1 operation is meaningless as it always evaluates to 0.

ACCU 2021 Call for Papers -- ACCU

The ACCU is now putting together its program, and they want you to speak on C++. The ACCU conference has strong C++ tracks, though it is not a C++-only conference. If you have something to share, check out their

Call for Papers

by the ACCU

About the conference:

The ACCU 2021 will be from 2021-03-10 to 2021-03-13, with a pre-conference workshops on 2021-03-09.

The ACCU 2021 will be an online event because of the COVID-19 pandemic.

Historically, ACCU has a lot of C++ and C content, and is proud of that: ACCU is the foremost annual conference for people interested in C++ and C, at least in and around the UK. But it is not just a C++ and C conference, ACCU is about programming in whatever language people are using, with whatever tools and processes people are using: D, Chapel, Java, Kotlin, C#, F#, Groovy, Rust, Go, Python, Ruby, Lisp, to name just a few programming languages about which there have been sessions at ACCU conferences. Git, Mercurial, CMake, Meson, TDD, BDD, allthese tools and techniques have been the focus of sessions at ACCU. The ACCU Conference is looking for sessions that will be interesting to people who create software.
The ACCU Conference is put on by ACCU (https://accu.org), but is open to anyone who wishes to be there either as a presenter or an attender.

The Call for Papers lasts for about 3 weeks and will close on Friday 2020-11-13 23:59 GMT

Checking a Header-Only C++ Library Collection (awesome-hpp)

Somehow, we've happened to check most of the libraries making up a collection called "Awesome hpp". These are small header-only projects in C++. Hopefully, the information about the bugs we've found will help make the libraries better.

Checking a Header-Only C++ Library Collection (awesome-hpp)

by Andrey Karpov

From the article:

A note for library developers. You can use PVS-Studio to check open-source projects for free. To get a free license to use with your open-source project, please fill in this form.

17 Smaller but Handy C++17 Features--Bartlomiej Filipek

Did you know about them?

17 Smaller but Handy C++17 Features

by Bartlomiej Filipek

From the article:

When you see an article about new C++ features, most of the time you’ll have a description of major elements. Looking at C++17, there are a lot of posts (including articles from this blog) about structured bindings, filesystem, parallel algorithms, if constexpr, std::optional, std::variant… and other prominent C++17 additions.

But how about some smaller parts? Library or language improvements that didn’t require decades to standardise or violent “battles” at the ISO meetings.

In this article, I’ll show you 17 (plus a few extra!) smaller C++17 things that will improve your code...

More and More Utilities in C++20--Rainer Grimm

Small but usefull things.

More and More Utilities in C++20

by Rainer Grimm

From the article:

Today, I present a few utilities for calculating the midpoint of two values, check if a std::string starts or ends with a substring, and create callables with std::bind_front. These little utilities may not seem so little when you need them...