How C++17 Benefits from the Boost Libraries

In today’s article, I’ll show you battle-tested features from the well-known Boost libraries that were adapted into C++17. With the growing number of elements in the Standard Library, supported by experience from Boost you can write even more fluent C++ code. Read on and learn about the cool things in C++.

READ MORE...

How to Convert Numbers into Text with std::to_char in C++17

In this post, I’ll show you how to use the newest, low-level, conversion routines form C++17. With the new functionality, you can quickly transform numbers into text and have super performance compared to previous techniques. Intro Until C++17, we had several ways of converting numbers into strings: sprintf / snprintf stringstream to_string itoa and 3rd-party libraries like boost - lexical cast And with C++17 we get another option: std::to_chars (along with the corresponding method from_chars) !

READ MORE...

Lazy initialisation in C++ and Multi-threading

In the previous post about lazy initialisation, we showed examples and differences between using raw pointers, unique_ptr and std::optional to store the object and create it later. However, we implemented the samples from the perspective of single-threaded scenarios. In this post, we’ll try to fill the gap and show you how to make your lazy objects available in a multithreading environment.

READ MORE...

Lazy Initialisation in C++

Lazy initialisation is one of those design patterns which is in use in almost all programming languages. Its goal is to move the object’s construction forward in time. It’s especially handy when the creation of the object is expensive, and you want to defer it as late as possible, or even skip entirely.

READ MORE...

C++ Ecosystem: Compilers, IDEs, Tools, Testing and More

To write a professional C++ application, you not only need a basic text editor and a compiler. You require some more tooling. In this blog post, you’ll see a broad list of tools that make C++ programming possible: compilers, IDEs, debuggers and other. Last Update: 14th October 2019. Note: This is a blog post based on the White Paper created by Embarcadero, see the full paper here: C++ Ecosystem White Paper.

READ MORE...

17 Smaller but Handy C++17 Features

When you see an article about new C++ features, most of the time you’ll see a description of major elements. Looking at C++17, there are a lot of posts (including articles from this blog) about structured bindings, filesystem, parallel algorithms, if constexpr, std::optional, std::variant… and other prominent C++17 additions.

READ MORE...

Moved or Not Moved - That Is the Question!

C++11 brought Move Semantics. Since then we have extra capabilities to write faster code, support movable-only types, but also more headaches :). At least I have, especially when trying to understand the rules related to that concept. What’s more, we also have copy elision, which is a very common optimisation (and even mandatory in several cases in C++17).

READ MORE...