Are you tired of needing 50 files open to be able to understand what a single component does?
Where do you begin when you are writing your first multithreaded program using C++20? Whether you've got an existing single-threaded application, or you're starting from scratch, C++20 provides the basic tools to help. In this talk we'll look at the C++20 facilities you should reach for first, and how to use them safely.
Making a trading system "fast" cannot be an afterthought. While low latency programming is sometimes seen under the umbrella of "code optimization", the truth is that most of the work needed to achieve such latency is done upfront, at the design phase. How to translate our knowledge about the CPU and hardware into C++? How to use multiple CPU cores, handle concurrency issues and cost, and stay fast?
Can a language whose official motto is “Avoid Success at All Costs” teach us new tricks in modern C++ ?
When we see large numbers or small fractions we automatically pick float or double floating-point types for our data representation. However, is it always optimal? What other choices we have? Are there any other standards than the IEEE 754 FP?
C++11 introduced std::function as a versatile tool that was lifted from boost to the STL.
C++23 will probably introduce std::move_only_function as the first major extension.
But it comes with some caveats that you should know.
With std::invoke introduced in C++17 it has become convenient to build your own derivatives.
Coroutines are a powerful addition to C++20, allowing developers to drastically simplify code for certain kinds of problems and be adapted to a wide range of different use cases. But anyone trying to familiarize themselves with them will quickly notice that this flexibility comes at a price: In their current state, C++ coroutines are notoriously difficult to learn and their tight integration with the compiler gives them a feel quite unlike any other feature in the language.
Real-time systems require that the runtime of critical code sections can be bounded. In particular, they need to guarantee that a specific algorithm does not violate its time bound. This relies on the underlying hardware, fair scheduling by the OS but also carefully crafted application code.
This talk presents a lightweight C++ monitoring API which allows to check for deadline violations in multiple threads at runtime. It also discusses time measurements when timestamps are subject to wrap-around. The implementation utilizes thread local storage and is lock-free on the regular path where the deadlines are met. It has low overhead and can be integrated in existing C++ code to introduce time constraints and gather runtime statistics.
While we wait for the Reflection TS to make it into C++, let’s have a look at what reflection is already possible with current C++. It turns out, quite a bit. This talk is an overview of all the different techniques people have found to do reflection without macros or markup already today. We will marvel at some of the ingenious (and crazy) ideas others have come up with to add more advanced reflection to C++....
At the core of an interpreter is a loop that iterates over instructions and executes them in order. This requires dispatching: based on the current instruction, it needs to select different code. A fast interpreter requires a fast instruction dispatcher, but so does everything else that needs to switch over a fixed set of different options.
With C++20 constexpr compiler support for dynamic memory allocation, and library support for std::vector/std::string now widely available (MSVC 19.29 (VS16.11), GCC 12.1's standard library (libstdc++), and accessible via Clang), a future C++ standard library can be foreseen, where every function and member function supports constant evaluation.
Automated software testing is probably the most important prerequisite for developing high-quality software quickly. Tests verify invariants during software development. This increases stability and improves efficiency of developers. In addition, proper testing makes it easier to collaborate on larger projects with well-defined, established components.
Universal/forwarding references were introduced in C++11 mainly for perfect forwarding of move semantics.
Optimizing compilers are awesome for sure. But how do they actually get all the information required to perform those mind-boggling optimizations? And how useful are constexpr and noexcept--do developers know better than the compiler?
Minimizing complexity in a codebase provides invaluable benefits, especially at scale, including but not limited to: maintainability, ease of understanding, malleability, debuggability, and testability. Such benefits translate not only into real economical advantages, but also increase the mental well-being of any developer.