std::variant, a so called “sum type”: a class that can, at one point in time, hold an object of one type out of a set of possible alternatives. On the surface, it’s a fairly simple concept, but it also enables a powerful new programming style: pattern matching. Originally coming from functional programming languages, pattern matching allows for very clear and straightforward code for a variety of use cases. While not being a first class language feature in C++, we can emulate it fairly well by using
std::variant and adding a bit of utility code to implement a
match function. This is possible even in C++11 by using libraries to provide a variant implementation.
Performance is one of the primary reasons developers use C++ today.
Nowadays, you very often hear about Modern CMake, but do you know what it really stands for. Do you know the difference to Traditional CMake? And do you know, that with the release of CMake 3.12 "More Modern CMake" has already entered the stage?
This release of CMake is a real game changer: It unifies and simplifies the way how build-targets can and should be used even further, so that using CMake should now be an easier (and more fun) experience for everyone.
Scientific programming is in itself a challenge due to several
concomitant issues and requirements including low response time, low
memory usage, minimizing numerical errors, error propagation.
At the last C++ committee meeting the 2D Graphics paper was voted down. One of the items in this paper was a collection of linear algebra classes. This collection forms the basis of a new proposal to add linear algebra to the standard library. This talk will walk you through what's on offer, why it should be standardised and how it's being put together.
Embarcadero has built C++ compilers that add language extensions beyond the language specification for over twenty years. Yet in those twenty years, the C++ language has changed drastically. What have we learned from these extensions and what might be valuable for the greater C++ community?
Telling the compiler when aliasing can or cannot happen is an important problem to solve. Lots of crucial compiler optimizations such as load and store elimination, and less crucial such as vectorization rely on alias analysis. I will showcase some examples where alias analysis is playing an important role to get decent performance. Unfortunately, there is no standard way in C++ to give hints to the compiler about aliasing. There is the C restrict keyword which is supported by some compilers but it has its own shortcomings. In this talk, I will show some of the past approaches to move restrict keyword to C++ and propose a new solution which is based on contracts. I will also show some basic tricks how to use type based alias analysis and value types to help compiler reason about aliasing until the related new features being accepted into the language....
CoRoutines are different. They allow us to build abstractions that were impossible before. Basically the Coroutine-TS introduced a new type of flow composition to C++.
The main driver for the introduction of Coroutines for C++ are asynchronous compositions. But there is so much more. It took me a while to realize how well thought out this TS is. Therefore I will try to share my conclusions with you.
It is essential to discuss how modern C++ code can be effectively instrumented, to benefit from advances in contemporary monitoring infrastructure. Awareness of this ecosystem and some straightforward techniques can drastically ease the troubleshooting of functional and performance issues, when they occur in production deployments.
Error code returns were bad so we invented exceptions. Much better we said.
Then we realised exceptions had their problems - with 52% of a recent ISO survey's respondents saying they were banned on all or part of their codebases! We've been trying to patch them up how we can (with noexcept, for example) - but most of the problems are systemic.
You may think that integral types are the simplest types in C++, but there are some surprising facts about them in the standard. Do you know, off the top of your head, what happens when they go out of range, get converted or promoted? Should you even need to know this as a C++ developer?
I will present a library that utilizes a feature of C++20 to build regular expressions from compile-time strings. This is a novel approach that doesn't have ordinary disadvantages of other regular expression implementations like having to use a linked library or a run-time cost of parsing and interpreting an internal finite machine.
You will see implementation details of the library and problems I have run into during its writing. In the last part of the talk, I will compare other implementations of regular expression engines and show compiled code in Compiler Explorer.
When you need a container, pick
std::vector<T> by default. This is common advice.
Many previous talks have shown how to fuzz-test trivial applications. This talk will aim to demonstrate how to apply these techniques to real-world software projects, whose components consume non-trivial data structures.
Higher order functions, i.e. functions that accept functions as parameters, or return functions, are not used much by C++ developers, except for the occasional call to standard algorithms.