News

Concepts in C++20 -- Richard Thomson

Richard Thomson gives an informal overview of Concepts in C++20 at the July, 2020 meeting of Utah C++ Programmers.

Concepts in C++20

by Richard Thomson

From the video description:

In this talk, Richard Thomson will give us an informal overview of Concepts in C++20. We'll take a look at the following details:

  • Concept syntax
  • Concepts in the standard library
  • Concepts relating to ranges
  • Improved error diagnostics (using compiler explorer)

YouTube: https://www.youtube.com/watch?v=KRB6b9SccvA

Illuminating Lambda Expressions in C++ -- Richard Thomson

Utah C++ Programmers has released a video on lambda expresssions in C++.

Illuminating Lambda Expressions in C++

by Richard Thomson

From the video description:

Richard Thomson gives us an insight into lambda expressions in C++ by showing the equivalent manually written function objects.  The presentation proceeds from lambda expressions as originally defined in C++11 and then proceeds through enhancements from C++14, C++17 and finally C++20.

YouTube: https://www.youtube.com/watch?v=GVqwkiqCj7w

The Royal Game -- Philipp Lenk

This time around, I shall tell you about the royal game, i.e. chess, or rather of my humble attempts at contributing to its rich ecosystem of non-human players.

The Royal Game

by Philipp Lenk

From the article

I will begin by explaining what I am talking about, briefly recap the fascinating history of computer chess and in the course of that highlight the importance of game playing for showcasing, popularizing and driving machine intelligence research as well as its public perception. I shall further elaborate on my personal connection and love for the game and detail why - even in the face of a recent uptake of machine learning based techniques far more successful than my puny attempts could ever hope to be - an old-school, classical approach can still be a valuable investment of time and energy.
Afterwards [...] I will get just a little more technical and provide a high level explanation of the general structure underlying many chess playing programs, culminating in a walkthrough of code implementing the UCI protocol used to communicate with GUIs and other programs pitting different human and non-human connoisseurs of the game against one another.

Create a new type when using std::variant -- Zhihao Yuan

Enough typedefs.

Create a new type when using std::variant

by Zhihao Yuan

From the article:

class rock {};
class paper {};
class scissors {};
using hand = std::variant<rock, paper, scissors>;

Ignoring the fact that this hand type comes with heavily overloaded constructors and you can only add free functions, a troublesome issue is that the type-name std::variant<rock, paper, scissors> will appear everywhere in debuggers and linkers in place of hand.

Conditionally Trivial Special Member Functions--Sy Brand

c++ magic.

Conditionally Trivial Special Member Functions

by Sy Brand

From the article:

The C++ standards committee is currently focusing on adding features to the language which can simplify code. One small example of this in C++20 is conditionally trivial special member functions, which we added support for in Visual Studio 2019 version 16.8. Its benefit isn’t immediately obvious unless you’ve been deep down the rabbit hole of high-performance library authoring, so I’ve written this post to show you how it can make certain generic types more efficient without requiring huge amounts of template magic...

How to Share Code with Const and Non-Const Functions in C++--Bartlomiej Filipek

How do you do it?

How to Share Code with Const and Non-Const Functions in C++

by Bartlomiej Filipek

From the article:

During the development of a container-like type, I run into the problem of how to share code between a const and non-const member functions. In this article, I’d like to explain what are the issues and possible solutions. We can even go on a bleeding edge and apply some C++20 features. Which technique is most friendly?