See a new article @CppStories with details about the latest updates for C++ Lambda Story. Now you can get the book in print!
See my new website at cppstories.com
Hi there!
My name is Bartek, I'm a programmer from Cracow/Poland. This is my blog about C++ and native coding.
Quick jump links:
- You can read more about me and the blog in the About section.
- Or see the Archive page with all blog posts.
- And, there's also the Start Page with the selection of best articles.

08 February 2021
C++ Lambda Story in Print @CppStories
18 January 2021
31 December 2020
28 December 2020
One 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
21 December 2020
C++ at the End of 2020, Survey
30 November 2020
Why 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 input from my readers and C++ experts. And today we’ll also have a look at one wording case - what’s a functor? And is a lambda a functor?
See @CppStories:
Why Not a Functor and Lambda Story Updates @CppStories
23 November 2020
New 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: Captures, Captures, Captures @C++Stories
16 November 2020
The 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 I'm happy to invite you to a fresh new post available only at cppstories.com!
Have a look:
02 November 2020
Runtime 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 technique might offer not only better performance and value semantics but also interesting design patterns.
26 October 2020
C++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 complexity of our generic code.
19 October 2020
17 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 structured bindings, filesystem, parallel algorithms, if constexpr
, std::optional
, std::variant
… and other prominent C++17 additions.
But how about some smaller parts? Library or language improvements that didn’t require decades to standardise or violent “battles” at the ISO meetings.
In this article, I’ll show you 17 (plus a few extra!) smaller C++17 things that will improve your code.
12 October 2020
Increased 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 declaration!
template <ranges::input_range R, std::weakly_incrementable O>
requires std::indirectly_copyable<ranges::iterator_t<R>, O>
constexpr ranges::copy_result<ranges::borrowed_iterator_t<R>, O>
copy(R&& r, O result);
How to decipher such a long declaration? What benefits do we get instead? Is it worth it? Let’s find out.
05 October 2020
How 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 dozens of new features. Have a look at my blog post with all C++17 features, it shows 48 items, and my C++20 reference card lists 47 elements!
Do you need to learn all of that stuff to write good code?
How to stay sane in the C++ world today?
28 September 2020
How 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 the end of the type sequence.
Have a look at today’s blog post from Jonathan Boccara, who describes a technique that might improve this situation. We’ll also look into the future.