The C++ Stories Weekly Newsletter

Join ~11000 developers who read about Modern C++, news reports, tools, and more! A new email every Monday.
Bonuses included! C++17/C++20 ref cards and more!

The above field is supplemented with consent to receive a newsletter containing information and marketing content about the cppstories.com portal from Bartłomiej Filipek codebf based in Krakow. The consent may be withdrawn at any time. See the full Privacy Policy.


See the latest articles:

C++ Smart Pointers and Arrays

Updated:

Smart pointers are very versatile and can hold pointers not only to single instances but also to arrays. Is that only a theoretical use case? or maybe they might be handy in some cases? Let’s have a look. Smart pointers for T[]   At C++ Stories, you can find lots of information about smart pointers - see this separate tag for this area.

READ MORE...

6 Ways to Refactor new/delete into unique ptr

Updated:

In legacy code, you can often spot explicit new and delete lurking in various places and waiting to produce pointer-related issues. This blog post shows six patterns to improve that erroneous style and rely on modern techniques, especially unique_ptr and other helper standard types. Bonus point 1: if possible, we’ll also look at some existing code from open source projects!

READ MORE...

C++ Smart Pointers Gotchas

Updated:

While learning how to use the new C++ Standard, I encountered several intriguing cases with smart pointers. Casting? Array handling? Passing to functions? Let’s review some common concerns so that we don’t shoot yourself in the foot :) I created this post back in 2013, and I updated it in 2014 and recently in 2021.

READ MORE...

C++ Smart Pointers Reference Card

Updated:

Smart pointers available since C++11 are an essential foundation for writing secure code in Modern C++. Thanks to RAII (Resource Acquisition Is Initialization), they allow you to work with pointers to allocate memory or other managed objects efficiently. This blog post will show you the core points for working with those handy types.

READ MORE...

C++20 Oxymoron: constexpr virtual

Updated:

Two keywords, constexpr and virtual - can those two work together? Virtual implies runtime polymorphism, while constexpr suggests constant expression evaluation. It looks like we have a contradiction, does it? Read on and see why those conflicting terms might help us get simpler code. A basic example   Imagine that you work with some product list, and you want to check if a product fits in a given box size:

READ MORE...

How to Parallelise CSV Reader - C++17 in Practice

Updated:

At C++Stories (and in my C++17 book) you can find several articles on Parallel Algorithms introduced in C++17. The examples included in those posts were usually relatively straightforward. How about writing something larger? In this text, you’ll see how to build a tool that works on CSV files, parses lines into sales records and then performs calculations on the data.

READ MORE...

C++ Lambda Story in Spanish!

Updated:

I’m happy to announce that after few months of work, the C++ Lambda Story book got translation into Spanish! Have a look at the background story and learn more about Lambdas :) This post is possible with the effort of Javier Estrada. Javier is a software developer living in sunny Southern California, and while he has flirted with Java and Python in the past, his true love is C++.

READ MORE...

Software Architecture with C++, Book Review

Updated:

In April, we got a new book - from two Polish authors - Piotr and Adrian - on C++ Software Architecture. This one is fascinating and refreshing. While it won’t teach you all the latest C++ features or low-level tricks in our favorite language, it will move you to a higher level with architecture, building, patterns, design, and development for the cloud.

READ MORE...