C++23 Language Features In this blog post, you’ll see all C++23 language features! Each with short description and additional code example. Prepare for a ride! Want your own copy to print? If you like, I prepared PDF I packed both language and the Standard Library features. Each one has a short description and an example if possible. All of the existing subscribers of my mailing list have already got the new document, so If you want to download it just subscribe here: Download a free ...| C++ Stories
With the introduction of C++17, the C++ Standard Library expanded its capabilities for converting text to numbers with the addition of std::from_chars. This low-level, high-performance API offers significant advantages over previous methods, such as atoi and stringstream. In this article, we will explore the evolution of string conversion routines from C++17 through C++26, highlighting key improvements like constexpr support and enhanced error handling.| C++ Stories
In this blog post, we’ll show how to implement a custom pipe operator and apply it to a data processing example. Thanks to C++23 and std::expectedwe can write a rather efficient framework that easily handles unexpected outcomes. This is a collaborative guest post by prof. Bogusław Cyganek: Prof. Cyganek is a researcher and lecturer at the Department of Electronics, AGH University of Science and Technology in Cracow, Poland.| C++ Stories
std::expected from C++23 not only serves as an error-handling mechanism but also introduces functional programming paradigms into the language. In this blog post, we’ll have a look at functional/monadic extensions of std::expected, which allow us to chain operations elegantly, handling errors at the same time. The techniques are very similar to std::optional extensions - see How to Use Monadic Operations for `std::optional` in C++23 - C++ Stories.| C++ Stories
In the article about std::expected, I introduced the type and showed some basic examples, and in this text, you’ll learn how it is implemented. A simple idea with struct In short, std::expected should contain two data members: the actual expected value and the unexpected error object. So, in theory, we could use a simple structure:| C++ Stories
In this article, we’ll go through a new vocabulary type introduced in C++23. std::expected is a type specifically designed to return results from a function, along with the extra error information. Motivation Imagine you’re expecting a certain result from a function, but oops… things don’t always go as planned:| C++ Stories
In this post we’ll have a look at new operations added to std::optional in C++23. These operations, inspired by functional programming concepts, offer a more concise and expressive way to work with optional values, reducing boilerplate and improving code readability. Let’s meet and_then(), transform() and or_else(), new member functions. Traditional Approach with if/else and optional C++20 In C++20 when you work with std::optional you have to rely heavily on conditional checks to ensur...| C++ Stories