So how do you quickly concatenate strings? -- Aleksandr Orefkov

So how do you quickly concatenate strings?

By Aleksandr Orefkov

From the article:

All practicing programmers have to concatenate strings. Precisely concatenate, we don’t have some JavaScript or PHP, in C++ we have this fancy word for it. Programmers in other languages ​​simply “add” strings together without much thought, without even thinking about this operation. After all, what could be simpler than

return "The answer is " + str_answer + ", count is " + count;

But while it’s forgivable for script kiddies not to think about the meaning behind such a simple notation, it’s unacceptable for an experienced developer to approach such an important issue so irresponsibly. An experienced developer, imagining such C++ code, immediately sees the terrifying abyss of problems that such an approach can create.

What type is str_answer? What type is count? “The answer is “ and “, count is “ - are literals that add to std::string as a const char*. So, strlen will be called. I wonder if the compiler will be able to optimize and calculate their length at compile time? Oh well, it seems like constexpr is in the addition, let’s hope so.
This is the first level of problems for now. And let’s say we successfully solved them, creating the following code:

std::string make_answer(std::string_view str_answer, int count) {
    return "The answer is " + std::string{str_answer}
        + ", count is " + std::to_string(count);
}

It sounds like “Hurray!”, but it’s somehow not loud enough…

15 Different Ways to Filter Containers in Modern C++ -- Bartłomiej Filipek

logo.pngFiltering items from a container is a common situation. Bartłomiej Filipek demonstrates various approaches from different versions of C++.

15 Different Ways to Filter Containers in Modern C++

by Bartłomiej Filipek

From the article:

Do you know how many ways we can implement a filter function in C++? While the problem is relatively easy to understand – take a container, copy elements that match a predicate and the return a new container – it’s good to exercise with the C++ Standard Library and check a few ideas. We can also apply some modern C++ techniques, including C++23. Let’s start!

The problem statement

To be precise by a filter, I mean a function with the following interface:

  auto Filter(const Container& cont,
              UnaryPredicate p) {}

It takes a container and a predicate, and then it creates an output container with elements that satisfy the predicate. We can use it like the following:

  const std::vector<std::string> vec{
    "Hello", "**txt", "World", "error", "warning",
    "C++", "****" };
  auto filtered = Filter(vec, [](auto& elem) {
    return !elem.starts_with('*'); });
    // filtered should have "Hello", "World",
    // "error", "warning", "C++"

Writing such a function can be a good exercise with various options and algorithms in the Standard Library. What’s more, our function hides internal things like iterators, so it’s more like a range-based version.

Coroutines – A Deep Dive -- Quasar Chunawala

logo.pngCoroutines are powerful but require some boilerplate code. Quasar Chunawala explains what you need to implement to get coroutines working.

Coroutines – A Deep Dive

by Quasar Chunawala

From the article:

Following on from the introduction in the editorial, let’s understand the basic mechanics needed to code up a simple coroutine, and I’ll show you how to yield from the coroutine and await results.

The simplest coroutine

The following code is the simplest implementation of a coroutine:

  #include <coroutine>
  void coro_func(){
    co_return;
  }
  int main(){
    coro_func();
  }

Our first coroutine will just return nothing. It will not do anything else. Sadly, the preceding code is too simple for a functional coroutine and it will not compile. When compiling with gcc 15.2, we get the error shown in Figure 1.

<source>: In function 'void coro_func()':
<source>:4:5: error: unable to find the promise type for this coroutine
    4 |     co_return;
      |     ^~~~~~~~~
 
Looking at C++ reference, we see that the return type of a coroutine must define a type named promise_type. Why do we need a promise? The promise_type is the second important piece in the coroutine mechanism. We can draw an analogy from futures and promises which are essential blocks for achieving asynchronous programming in C++. The future is the thing, that the function that does the asynchronous computation, hands out back to the caller, that the caller can use to retrieve the result by invoking the get() member function. The future has the role of the return object. 

Concurrency Flavours -- Lucian Radu Teodorescu

logo.pngConcurrency has many different approaches. Lucian Radu Teodorescu clarifies terms, showing how different approaches solve different problems.

Concurrency Flavours

by Lucian Radu Teodorescu

From the article:

Most engineers today use concurrency – often without a clear understanding of what it is, why it’s needed, or which flavour they’re dealing with. The vocabulary around concurrency is rich but muddled. Terms like parallelism, multithreading, asynchrony, reactive programming, and structured concurrency are regularly conflated – even in technical discussions.

This confusion isn’t just semantic – it leads to real-world consequences. If the goal behind using concurrency is unclear, the result is often poor concurrency – brittle code, wasted resources, or systems that are needlessly hard to reason about. Choosing the right concurrency strategy requires more than knowing a framework or following a pattern – it requires understanding what kind of complexity you’re introducing, and why.

To help clarify this complexity, the article aims to map out some of the main flavours of concurrency. Rather than defining terms rigidly, we’ll explore the motivations behind them – and the distinct mindsets they evoke. While this article includes a few C++ code examples (using features to be added in C++26), its focus is conceptual – distinguishing between the flavours of concurrency. Our goal is to refine the reader’s taste for concurrency.

Exclusive state access, I -- Andrzej Krzemieński

krzemienskivaluesemantics.pngValue semantics is a way of structuring programs around what values mean, not where objects live, and C++ is explicitly designed to support this model. In a value-semantic design, objects are merely vehicles for communicating state, while identity, address, and physical representation are intentionally irrelevant.

Exclusive state access, I

by Andrzej Krzemieński

From the article:

Value semantics is a way of organizing your programs, which C++ supports and endorses. Its key characteristics in a nutshell:

  1. Throughout its lifetime an object (via its type and special member functions) is used to represent a value.
  2. Different parts of the program communicate values via objects. While the value matters, objects themselves (their address, their sizeof) do not.
  3. Object’s value is isolated from other objects’ values.

This begs the question, what is value, but we will not answer it. First, because it is difficult, and maybe impossible. It is pretty clear what value objects of type int represent. It is fairly uncontroversial what value is represented by vector<int>, once we accept that the value representation need not fit into the sizeof of the object, but can spread across other memory locations and resources, and that vector’s capacity is not part of this value, even though it is part of its state. But there are things like std::mutex where naming the value is tricky.

Singleton done right in C++ -- Andreas Fertig

andreasfertig.pngIn today's post, I like to touch on a controversial topic: singletons. While I think it is best to have a codebase without singletons, the real-world shows me that singletons are often part of codebases.

Singleton done right in C++

by Andreas Fertig

From the article:

Let's use a usage pattern for a singleton that I see frequently, a system-wide logger. A simple implementation can look like the following code:

class Logger {
  Logger() = default;

public:
  static Logger& Instance()
  {
    static Logger theOneAndOnlyLogger{};

    return theOneAndOnlyLogger;
  }

  void Info(std::string_view msg) { std::print("Info: {}", msg); }
  void Error(std::string_view msg) { std::print("Error: {}", msg); }
};

The key parts for a singleton in C++ are that the constructor is private and an access function that is static. With that, you ensure that a singleton object, here Logger can only be constructed by calling Instance, essentially limiting the number of Logger objects to a single one.

You're using such a Logger like this:

Logger::Instance().Info("A test");



Trainings at using std::cpp 2026 with Mateusz Pusz and Jeff Garland

Once more the using std::cpp conference is here and they bring two interesting training workshops.

  • Mastering std::execution: A Hands-On Workshop by Mateus Pusz.
    https://www.fundacion.uc3m.es/formacion/mastering-stdexecution-a-hands-on-workshop/
  • Function and Class Design with C++2x by Jeff Garland.
    https://www.fundacion.uc3m.es/formacion/function-and-class-design-with-c2x/

Both workshops happen in the post-conference day on March 19th in Madrid.

You may also want to have a look to the list of speakers for the main conference.

If you are one of the first 20 attendees to each workshops, your are eligible for a free ticket for the main conference.

Talk: Who’s Afraid of the Big Bad Template -- Coral Kashri

2026-01-09_11-18-10.png

Templates and metaprogramming considered as the big bad wolf of C++, and it’s time to stop being scared of this wolf, as it’s one of the most powerful creatures of C++.

Talk: Who’s Afraid of the Big Bad Template

by Coral Kashri

From the description:

In this talk I’ve demonstrated the power of this incredible creature, while I hope that this talk would be an easy enterence to this concept (pan intended), and to help you developing the anticipation to walk into the cave of metaprogramming.

The talk was give on Core C++ 2025.

Talk: Who’s Afraid of the Big Bad Template -- Coral Kashri

 

2026-01-09_11-18-10.png

Templates and metaprogramming considered as the big bad wolf of C++, and it’s time to stop being scared of this wolf, as it’s one of the most powerful creatures of C++.

Talk: Who’s Afraid of the Big Bad Template

by Coral Kashri

From the description:

In this talk I’ve demonstrated the power of this incredible creature, while I hope that this talk would be an easy enterence to this concept (pan intended), and to help you developing the anticipation to walk into the cave of metaprogramming.

The talk was give on Core C++ 2025.

2025, A Year of Conferences -- Sandor Dargo

cpponsea2025-folkestone-to-dover.jpgConferences are never just about the talks — they’re about time, travel, tradeoffs, and the people you meet along the way. After a year of attending several C++ events across formats and cities, this post is a personal look at how different conferences balance technical depth, community, and the experience of being there.

2025, A Year of Conferences

by Sandor Dargo

From the article:

This year I had the chance to attend three conferences onsite, plus one online, and even a meetup in my hometown, Budapest. Depending on who you ask, maybe it’s not a lot — I know some speakers do twice as many. But if you ask my family, you’d probably get a different (and understandable) answer. For me — for us — it’s a lot. It’s also an honour and a privilege in many ways.

To express my appreciation and gratitude toward the organizers and the community, I do two things:

  • I try to prepare well for my talks.
  • I post trip reports soon after each event — usually within a week.

Those trip reports are moderately personal: I share which talks I liked and also some of my impressions, but I try to make them useful rather than purely personal. Still, I think that once in a while, a more personal, less serious post has its place — and that’s what this one wanted to be originally.

At one of the social dinners at CppCon, a developer working for a FAANG company in New York asked me which conference I’d recommend. My answer: it depends on your goals — and your budget and constraints.