C++ Stories in March
Have a look at a short summary of the best articles from March 2021 from the C++ community.Reminder: I publish new articles at the converted website cppstories.com.Read more...
View ArticleC++ Lambda Story in Print @CppStories
See a new article @CppStories with details about the latest updates for C++ Lambda Story. Now you can get the book in print!C++ Lambda Story in Print
View ArticleFirst Year At Patreon
A bit more than a year ago I started my Patreon page! It was an experiment, and I’m pleased that it has a lot of benefits. In this short blog post, I’d like to make a small summary, share my thoughts...
View ArticleC++ at the end of 2020! @CppStories
See my summary article!Available @C++Stories:C++ At the end of 2020
View ArticleOne Trick with Private Names and Function Templates @C++Stories
Have a look at a new article @C++Stories! This time I have one trick with nested types, private names and function templates. See her:One Trick with Private Names and Function Templates
View ArticleC++ at the End of 2020, Survey
It’s almost the end of the year!I prepared a quick survey, so we can learn about our experience with the language.Read more...
View ArticleWhy Not a Functor and Lambda Story Updates @CppStories
I’m happy to announce a new update to my book on lambda expressions! A few pages more, and what’s important is that I heavily improved the consistency and some wording. All of that, thanks to valuable...
View ArticleNew post at C++ Stories: Under the Covers of C++ Lambdas
See a new blog post at C++ Stories!This time it's a guest post by Andreas Fertig who explains the problems of translating lambda syntax into the closure type.See here:Under the Covers of C++ Lambdas:...
View ArticleThe First New Article on C++ Stories!
Since more than a year I've been developing a "shadow" website called C++ Stories that will eventually take please of this blog. The site is live and most of my articles are also available there.Today...
View ArticleRuntime Polymorphism with std::variant and std::visit
Runtime polymorphism usually connects with v-tables and virtual functions. However, in this blog post, I’ll show you a modern C++ technique that leverages std::variant and std::visit. This C++17...
View ArticleC++20 Ranges, Projections, std::invoke and if constexpr
Continuing the topic from last week, let’s dive into the topic of std::invoke. This helper template function helps with uniform syntax call for various callable object types and can greatly reduce the...
View Article17 Smaller but Handy C++17 Features
When you see an article about new C++ features, most of the time you’ll have a description of major elements. Looking at C++17, there are a lot of posts (including articles from this blog) about...
View ArticleIncreased Complexity of C++20 Range Algorithms Declarations - Is It Worth?
With the addition of Ranges and Concepts in C++20, our good old algorithm interfaces got super long “rangified” versions. For example, copy is now 4 lines long… and it’s just the...
View ArticleHow To Stay Sane with Modern C++
C++ grows very fast! For example, the number of pages of the C++ standard went from 879 pages for C++98/03 to 1834 for C++20! Nearly 1000 pages! What’s more, with each revision of C++, we get several...
View ArticleHow to Pass a Variadic Pack as the First Argument of a Function in C++
Variadic templates and argument packs which are available since C++11 give flexibility in situations when you don’t know the number of inputs upfront. However, they are limited and can only appear at...
View ArticleHow I Improved My Legacy C++ Project with PVS-Studio
Since a few months, I’ve been refactoring my old C++/OpenGL project. Thus far, I used compilers (MSVC and Clang), my knowledge or free tools. At some point, I also got a chance to leverage a solid...
View ArticleReplacing unique_ptr with C++17's std::variant a Practical Experiment
Some time ago I wrote about a new way to implement runtime polymorphism which is based not on virtual functions but on std::visit and std::variant. Please have a look at this new blog post where I...
View Article6 Efficient Things You Can Do to Refactor a C++ Project
I took my old pet project from 2006, experimented, refactored it and made it more "modern C++". Here are my lessons and six practical steps that you can apply in your projects. Let’s startRead more...
View ArticleC++17: Polymorphic Allocators, Debug Resources and Custom Types
In my previous article on polymorphic allocators, we discussed some basic ideas. For example, you’ve seen a pmr::vector that holds pmr::string using a monotonic resource. How about using a custom type...
View ArticleHow to Check String or String View Prefixes and Suffixes in C++20
Up to (and including) C++17 if you wanted to check the start or the end in a string you have to use custom solutions, boost or other third-party libraries. Fortunately, this changes with C++20.See the...
View Article