CppCon 2024 Using PMR in C++ Embedded Systems for Functional Safety -- Scott Dixon

pmr-dixon.pngRegistration is now open for CppCon 2025! The conference starts on September 15 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from last year's conference. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2025!

Lightning Talk: Using PMR in C++ Embedded Systems for Functional Safety

by Scott Dixon

Summary of the talk:

Dynamic memory is often disallowed in high-assurance, c++ embedded systems but, when examining the reasons why, C++17 Polymorphic Memory Resources emerge as an unexpected solution to enable the use of C++ standard library constructs for such projects. My talk will explore how PMR can be used to meet functional safety requirements and to build embedded systems that are robust, performant, and testable.

C++26: More constexpr in the Standard Library -- Sandor Dargo

SANDOR_DARGO_ROUND.JPGHere are the standard library features that will soon be usable at compile time. One topic is missing: exceptions. As they need both core language and library changes, I thought they deserved their own post.

C++26: More constexpr in the Standard Library

by Sandor Dargo

From the article:

P2562R1constexpr stable sorting

This paper proposes making std::stable_sortstd::stable_partitionstd::inplace_merge, and their ranges counterparts usable in constant expressions. While many algorithms have become constexpr over the years, this family related to stable sorting had remained exceptions — until now.

The recent introduction of constexpr containers gives extra motivation for this proposal. If you can construct a container at compile time, it’s only natural to want to sort it there, too. More importantly, a constexpr std::vector can now support efficient, stable sorting algorithms.

A key question is whether the algorithm can meet its computational complexity requirements under the constraints of constant evaluation. Fortunately, std::is_constant_evaluated() provides an escape hatch for implementations. For deeper details, check out the proposal itself.

CppCon 2024 Back to Basics: Unit Testing in C++ -- Dave Steffen

unittesting-steffen.pngRegistration is now open for CppCon 2025! The conference starts on September 15 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from last year's conference. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2025!

Back to Basics: Unit Testing in C++

by Dave Steffen

Summary of the talk:

Unit Testing is a big, complicated subject. With good advice coming in from books, conference talks, and blog posts beyond count, it's a daunting topic even for experienced developers.  Can we make the subject more approachable?

Yes we can.  If we look a little deeper, there are some fundamental principles behind the advice. Further, these principles seem to belong to a small number of "domains", each addressing a very different aspect of unit testing and software development.

For example, "Test error conditions separately", "Tests should be easy to read", and "Write the unit tests first" are all great advice, but each is aiming for a very different goal.

In this talk, we'll survey these domains of unit testing practice, identify some of the basic practices involved in each, and put the larger discussion of unit testing into a more useful context.  We will also see how some unit testing practices enhance or conflict with others, and how these controversies reveal deep philosophical questions that have real consequences for how we go about the day-to-day activity of testing our code.

The voting on the talks for Meeting C++ 2025 has begun!

This week the voting for the talks at Meeting C++ 2025 starts!

The voting on the talks for Meeting C++ 2025 has begun!

by Jens Weller

From the article:

Once again its time for the C++ community to take a look at the submitted talks for Meeting C++ 2025! Thanks to all folks who have submitted a talk to this years conference! Your contribution will create another great conference in Berlin and online! And special thanks to all folks who have bought tickets already for the conference, you'll have a bit more weight in the voting to shape this years program!

With your voting session you can contribute to the talk selection for this years conference. In total 107 talks are submitted by 73 speakers. With this year the call for talks closes earlier than in the past, when for a few years it had extended to match the submission date with CppCon. Since last year CppCon has moved its deadline into early/mid May, which is a bit too early. For the future I plan to have the call for talks close around the beginning of June. A period of 2 months to submit should be enough, also this allows for an earlier release of the program. This than gives speakers more time to get their talks ready and Meeting C++ more time to advertise the program...

 

CppCon 2024 The Main Points in C++ - Dots in C++ -- Miodrag Misha Djukic

mainpoints-djukic.pngRegistration is now open for CppCon 2025! The conference starts on September 15 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from last year's conference. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2025!

Lightning Talk: The Main Points in C++ - Dots in C++

by Miodrag Misha Djukic

Summary of the talk:

A simple element of punctuation marks -- a point (dot) -- but used for so much. What are the all the ways a point is used in C++? Can you list them all? One point (dot), two points (colon), three points (ellipsis), four points (double colon). Let’s quickly go over all the usages: a well known ones, but also some that are encountered not so often.

Fixing exception safety in our task_sequencer -- Raymond Chen

RaymondChen_5in-150x150.jpgSome time ago, we developed a task_sequencer class for running asynchronous operations in sequence. There’s a problem with the implementation of Queue­Task­Async: What happens if an exception occurs?

Fixing Exception Safety in our task_sequencer

by Raymond Chen

From the article:

Let’s look at the various places an exception can occur in Queue­Task­Async.

    template<typename Maker>
    auto QueueTaskAsync(Maker&& maker) ->decltype(maker())
    {
        auto current = std::make_shared<chained_task>();
        auto previous = [&]
        {
            winrt::slim_lock_guard guard(m_mutex);
            return std::exchange(m_latest, current); ← oops
        }();

        suspender suspend;

        using Async = decltype(maker());
        auto task = [](auto&& current, auto&& makerParam,
                       auto&& contextParam, auto& suspend)
                    -> Async
        {
            completer completer{ std::move(current) };
            auto maker = std::move(makerParam);
            auto context = std::move(contextParam);

            co_await suspend;
            co_await context;
            co_return co_await maker();
        }(current, std::forward<Maker>(maker),
          winrt::apartment_context(), suspend);

        previous->continue_with(suspend.handle);

        return task;
    }

If an exception occurs at make_shared, then no harm is done because we haven’t done anything yet.

If an exception occurs when starting the lambda task, then we are in trouble. We have already linked the current onto m_latest, but we will never call continue_with(), so the chain of tasks stops making progress.

To fix this, we need to delay hooking up the current to the chain of chained_tasks until we are sure that we have a task to chain. 

CppCon 2024 Cost of C++ Abstractions in C++ Embedded Systems -- Marcell Juhasz

abstractions-juhasz.pngRegistration is now open for CppCon 2025! The conference starts on September 15 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from last year's conference. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2025!

Cost of C++ Abstractions in C++ Embedded Systems

by Marcell Juhasz

Summary of the talk:

This session will feature detailed case studies that measure the overhead associated with common programming abstractions in the context of embedded systems. By examining both compile-time and run-time implications, attendees will gain valuable insights into how these abstractions impact system resources like memory usage and execution speed.

Key areas of exploration will include:

Encapsulation: Assessing the cost of data hiding and interface protection depending on implementation strategies.
Inheritance: Evaluating the costs and benefits of using class hierarchies in environments where memory and processing power are limited.
Polymorphism: Comparing run-time polymorphism via virtual functions to compile-time alternatives like templates and concepts, analyzing their respective impacts on performance and flexibility.

Through empirical data and performance metrics, participants will observe how traditional object-oriented techniques affect resource utilization. The discussion will also cover the advantages and trade-offs of these techniques, providing a balanced view of their impact on embedded systems.

Designed for developers and system architects working within the constraints of embedded systems, this talk aims to provide valuable insights into making informed decisions about when and how to use specific programming abstractions. Attendees will leave with a clearer perspective on optimizing their code for maximum efficiency, armed with practical knowledge about the trade-offs involved in adopting various software design paradigms.

How to Join or Concat Ranges, C++26 -- Bartlomiej Filipek

howtojoinconcat-filipek.pngC++ continues to refine its range library, offering developers more efficient and expressive ways to manipulate collections. In this post, we'll dive into three powerful range adaptors—concat_view, join_view, and join_with_view—exploring their differences, use cases, and practical examples.

How to Join or Concat Ranges, C++26

by Bartlomiej Filipek

From the article:

Modern C++ continuously improves its range library to provide more expressive, flexible, and efficient ways to manipulate collections. Traditionally, achieving tasks like concatenation and flattening required manual loops, copying, or custom algorithms. With C++’s range adaptors, we now have an elegant and efficient way to process collections lazily without unnecessary allocations.

In this post, we will explore three powerful range adaptors introduced in different C++ standards:

  • std::ranges::concat_view (C++26)
  • std::ranges::join_view (C++20)
  • std::ranges::join_with_view (C++23)

Let’s break down their differences, use cases, and examples.

std::ranges::concat_view (C++26)

The concat_view allows you to concatenate multiple independent ranges into a single sequence. Unlike join_view, it does not require a range of ranges—it simply merges the given ranges sequentially while preserving their structure.

In short:

  • Takes multiple independent ranges as arguments.
  • Supports random access if all underlying ranges support it.
  • Allows modification if underlying ranges are writable.
  • Lazy evaluation: No additional memory allocations.

CppCon 2024 Rust Programming in 5 Minutes -- Tyler Weaver

rustprogramming-weaver.pngRegistration is now open for CppCon 2025! The conference starts on September 15 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from last year's conference. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2025!

Lightning Talk: Rust Programming in 5 Minutes

by Tyler Weaver

Summary of the talk:

I'm now working in Rust and now I have time for all sorts of frivolous learning. It is glorious. I'm going to try in 5min to teach a bit of Rust to a C++ audience.