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++23/C++20/C++17 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:

Deprecating Raw Pointers in C++20

Updated:

The C++ Standard moves at a fast pace. Probably, not all developers caught up with C++11/14 yet and recently we got C++17. Now it’ time to prepare C++20! A few weeks ago The C++ Committee had an official ISO meeting in Jacksonville, FL (12-17 March 2018) where they worked hard on the new specification.

READ MORE...

Static Variables Initialization in a Static Library, Example

Updated:

This post is motivated by one important comment from my last article about factories and self-registering types: (me) So the compiler won’t optimize such variable. Yet, unfortunately, the linker will happily ignore it if linking from a static library. So… what’s the problem with the linker? Intro   The main idea behind self-registering types is that each class need to register in the factory.

READ MORE...

Factory With Self-Registering Types

Updated:

Writing a factory method might be simple: unique_ptr<IType> create(name) { if (name == "Abc") return make_unique<AbcType>(); if (name == "Xyz") return make_unique<XyzType>(); if (...) return ... return nullptr; } Just one switch/if and then after a match you return a proper type. But what if we don’t know all the types and names upfront?

READ MORE...

How to propagate const on a pointer data member?

Updated:

Inside const methods all member pointers become constant pointers. However sometimes it would be more practical to have constant pointers to constant objects. So how can we propagate such constness? The problem   Let’s discuss a simple class that keeps a pointer to another class. This member field might be an observing (raw) pointer, or some smart pointer.

READ MORE...

The Pimpl Pattern - what you should know

Updated:

Have you ever used the pimpl idiom in your code? No matter what’s your answer read on :) In this article I’d like to gather all the essential information regarding this dependency breaking technique. We’ll discuss the implementation (const issue, back pointer, fast impl), pros and cons, alternatives and also show examples where is it used.

READ MORE...

C++ Status at the end of 2017

Updated:

In Poland, it’s only a few hours until the end of the year, so it’s an excellent chance to make a summary of things that happened to C++! As you might guess the whole year was dominated by the finalization and publication of C++17. Yet, there are some other “big” things that happened.

READ MORE...

Summary of C++17 features

Updated:

How do you see the new C++ standard? Is it ok? Great? Meh? Last week, after a few years of break, I presented my new talk that addressed the above question! It happened at the Cracow C++ Local Group. Have a look what’s inside this talk. Intro   Listing all of the features from the new standard might sound simple at first glance.

READ MORE...