Home
Sandor Dargo's Blog
Cancel

Hands-On Design Patterns with C++ by Fedor Pikus

In Hands-On Design Patterns with C++, the author Fedor Pikus shares the most common design patterns used in modern C++. In fact, not only design patterns but also some best practices and idioms. He...

6 C++23 features improving string and string_view

In this blog post, let’s collect a couple of changes that are going to be shipped with C++23 and are all related to strings or string_views. std::string and std::string_view have contains One of ...

What are string_views and why should we use them?

std::string_view has been introduced by C++17 and its purpose is to provide read-only access to character sequences. It potentially replaces const string& parameters and offers a significant pe...

Won't extend it more than once!

A few months ago I changed teams and I started to work on a library that helps its users to perform cryptographic operations. Those operations need a so-called Hardware Security Module (HSM) that i...

C++: standardized

In this article, let’s step back from coding a little bit. We are going to discuss how C++ was born and how it’s been evolving ever since. We’ll only have a brief overview of what happened in the l...

Bitwise enumerations

In C++ the size of a bool is 1 byte. That’s the case despite that it can only have two values, true or false which can be represented on one single bit. This might not be a concern all the time, bu...

C++23: Narrowing contextual conversions to bool

In the previous article discussing new language features of C++23, we discussed if consteval. Today, we’ll slightly discuss if constexpr and also static_assert. Andrzej Krzemieński proposed a paper...

The Evolution of Cooperation by Robert Axelrod

How to maximize the benefits of cooperation? Is it better to cooperate with others or to defect? How to decide? How to react when you’re a good person but you’re taken advantage of? Can we avoid es...

Smart pointers and their deleters

Bjarne Stroustrup, the father of C++ once said that “C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off.” Why did he say so? What makes...

C++23: Consteval if to make compile time programming easier

Let’s continue our exploration of C++23 features! This week we discuss how to call consteval functions from not explicitly constant evaluated ones. This paper, this new feature is also a good exam...