In this talk, you'll learn all you need to know about one of the flagship features of C++20; concepts. First, I'll explain the concept behind concepts, why templates needed this extension. Then we'll discover the different ways concepts can be used with functions and with classes. What kind of concepts do we get with the standard library of C++20? That's also something we'll discuss, right before we will start the most interesting part of this session; how to write your own concepts? From the simplest we'll go towards more complex examples while describing all the different constraints we express with concepts. We'll finish with some real-life examples where concepts can document better and/or simplify our codebase.
...“If I could go back in time and had the power to change C++, rather than adding virtual function, I would add language support for type erasure …” (Eric Niebler, June 19, 2020, Twitter).
Multi-core systems are ubiquitous and allow concurrent algorithms to be used in a broad field of applications, e.g. robotics and autonomous driving. Usually locking strategies are employed to protect shared data. For real-time systems with high availability requirements this can be undesirable, as it may lead to deadlocks and lockouts in case of partial system failure or delayed threads. Lock-free programming offers an alternative by forgoing locks and using specific atomic operations such as compare-exchange to guarantee race-free access to shared data. This makes it impossible for any failing operation to block another operation and can drastically improve responsiveness while also avoiding problems like priority inversion.
C++ is a predominant Object-Oriented programming language, according to a large popular belief. And, according to the same belief, inheritance is the best tool to write good C++ code.
We heard it all, pass by const-reference if you intend to read, by value if you want to take. Return by … now, with return
it gets complicated. More often than not, it is return by value and hope for the copy-elision to kick in. However, in some corner cases, you might consider returning an rvalue reference to improve performance or wrapping things in a tuple when multiple values are at play. Oh, and there are also universal references as parameters, and structured bindings or std::tie
for accessing tuple’s elements returned by functions. After some digging, you might even discover parameter packs or the fact that capturing into a lambda is actually passing arguments to the constructor of an unnamed object.
If...
How can one use the latest and greatest features of C++ to create an API
which can be used easily and intuitively? Or write a complex algorithm
which is still easy to understand and requires just minimal documentation?
In this talk we will discuss polymorphic memory resources and some of their more advanced usage cases.
Modules are probably the most impactful and most transformative recent major addition to the C++ language. From a user perspective, Modules are conceptually simple and the idea is easy to grasp. And with the C++20 ecosystem maturing, using Modules and adopting them into every-day programming is both feasable and advantageous.
EVE is a new library that exposes SIMD in a uniform way across both ARM (neon) and x86 (from sse2 to avx-512).
Demo: vectorized find for x86 and arm on godbolt: https://godbolt.org/z/n6Pds78s6
In this case study, we will take a look into how Python-style named tuples can be implemented in C++20.
The goal will be to test and implement the following snippet from scratch with modern C++ features.
In this talk Daniel will present how to use C++ coroutines with the Qt Framework. He will present the QCoro library that allows using certain Qt types with coroutines and will show how it makes the code easier to write and read, safer and more streamlined. He will explain how the QCoro library works under the hood and how it can be extended to support custom types.
This talk covers all the necessary knowledge about atomics that you need to know to get a good understanding of how atomics work under the hood and make sure your code is correct.
Robert Pirsig’s 1974 bestselling classic, “Zen and the Art of Motorcycle Maintenance” was not about Zen or Motorcycles - although both made an appearance. The subtitle gives you more of an idea: “An Inquiry into Values” - but it was only later that the main concepts in the book, along with the sequel, “Lila” came to form part of “A Metaphysics of Quality”.
Quality,...
One of the greatest shifts in modern programming practices has been how programmers across many different domains and languages have embraced unit testing. For the C++ programmer, however, a lot of what has been said and done in the unit testing space, from test-driven development to unit-testing frameworks, has left them behind the rest of the field. Most of the blogs and talks and advice out there is targeted at languages that are dynamic or garbage collected or whose runtime behaviour does not have the 'here be dragons' territories of undefined behaviour.
This session looks at good unit tests (GUTs) and test-driven development (TDD) from the perspective of C++. This talk focuses on the mindset and the practices that support other desirable qualities, such as dependency management, pluggable behaviour and immutability.
Welcoming everyone to Meeting C++ 2021!