2012=

Simple Compile-Time Dynamic Programming in Modern C++ -- Andrew Drakeford

logo.pngCompile time code can be very efficient. Andrew Drakeford demonstrates how to write efficient chains of matrix multiplication.

Simple Compile-Time Dynamic Programming in Modern C++

by Andrew Drakeford

From the article:

Modern C++ enables us to solve mathematical optimisation problems at compile time. With the expanded constexpr capabilities [Fertig21Turner18Turner19Wu24], we can now write clear and efficient optimisation logic that runs during compilation. Fixed-size containers such as std::array fit naturally into these routines. Even standard algorithms, such as std::sort and std::lower_bound, are now constexpr, enabling more straightforward code and more powerful compile-time computations. Additionally, compile-time optimisation generates constant results, which enables the compiler to create even more efficient code. We will use the matrix chain multiplication problem as our worked example.

Matrix chain multiplication

Matrix chain multiplication is a classic dynamic programming problem [Corman22Das19Mount]. It aims to determine the most efficient method for multiplying a sequence of matrices. Since matrix multiplication is associative, the order of grouping does not affect the result. However, the number of scalar multiplications involved can vary depending on the grouping.

Consider the three matrices A₁ (10×100), A₂ (100×5), and A₃ (5×50), multiplied in a chain, A₁ × A₂ × A₃.

There are two ways to multiply them:

  1. Grouping as (A₁ × A₂) × A₃ first computes a 10×5 matrix, then multiplies that with A₃. This results in 5,000 operations for the first multiplication, and another 2,500 for the second – a total of 7,500 scalar multiplications.
  2. Grouping as A₁ × (A₂ × A₃) first multiplies A₂ and A₃, then A₁. This results in 25,000 operations for the first step and 50,000 for the second – a total of 75,000, which is clearly worse.

C++26 reflection at compile-time -- Andreas Fertig

797f4c8c0b89b22b.pngIn today's post, I like to talk about C++26 and one of the probably most impactful features that have been added to the working draft. While C++26 is still some months away from official completion, since the WG21 summer meeting in June we all now know what will be in C++26.

C++26 reflection at compile-time

by Andreas Fertig

From the article:

While the new standard will have plenty of great improvements the one that will most likely change a lot is reflection at compile-time! In Sofia we voted seven reflection papers into C++26:

  • P1306R5 Expansion statements
  • P2996R13 Reflection for C++26
  • P3096R12Function parameter reflection in reflection for C++26
  • P3293R3Splicing a base class subobject
  • P3394R4Annotations for reflection
  • P3491R3define_static_
  • P3560R2Error handling in reflection

The papers above should give you enough to read for your vacation. I'll leave that theoretical study up to you for now.

Let's talk practical

The main question is, what can you do with that new feature? Well, I'm not the first one who published their ideas.

Format your own type (Part 2) -- Sandor Dargo

SANDOR_DARGO_ROUND.JPGPreviously, we discussed how to write our own formatter and finished with a relatively simple solution for printing a struct called ProgrammingLanguage. Today, we’ll take it to the next level.

Format your own type (Part 2)

by Sandor Dargo

From the article:

Add more options for semantic versioning

Let’s dream big. Instead of only handling major and minor versions (like Python 3.12), let’s aim to fully support semantic versioning.

Semantic versioning (SemVer) is a versioning scheme that conveys meaning about the underlying changes in a release. It typically consists of three parts: MAJOR.MINOR.PATCH.

We should be able to print all these correctly:

ProgrammingLanguage cpp{"C++", 20};
ProgrammingLanguage python312{"Python", 3, 12};
ProgrammingLanguage python31211{"Python", 3, 12, 11};


std::cout << std::format("{:%n%v} is fun", cpp) << '\n';  // C++20 is fun
std::cout << std::format("{:%n %v} is fun", python312) << '\n';  // Python 3.12 is fun
std::cout << std::format("{:%n %v} is fun", python31211) << '\n';  // Python 3.12.11 is fun

CppCon 2025 The Programmer CEO -- Greg Law

Registration is now open for CppCon 2025! The conference starts on September 13 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2025!

The Programmer CEO

Wednesday, September 17 16:45 - 17:45 MDT

by Greg Law

Summary of the talk:

Many programmers think about starting a company. It’s often not about getting rich so much as to pursue a vision for a computer program that is much bigger than one person could write alone. Like most programmers who start up, I had no formal training and little experience outside of software development. I was naively confident, and didn’t know what I didn’t know (it turned out that that was a LOT!)

The talk includes some of the lessons I’ve learned along the way, many of which were a complete surprise. I’ll cover getting investment, building the product, building a team, and getting and keeping customers. Little of this talk is directly about programming, but it is aimed at programmers who want to create code in order to create a business, or who want to create a business so that they can create the code they want.

Much of the content is also relevant for programmers who find themselves doing non-programming tasks, such as managing people or customer-facing roles, and anyone working at a start-up. Contains candid, warts-and-all war stories, and because it’s for programmers, comes with a no adverts and no business-talk BS guarantee.

Greg is co-founder and CEO at Undo. He is a programmer at heart, but likes to keep one foot in the software world and one in the business world. Greg finds it particularly rewarding to turn innovative software technology into a real business. Greg has over 25 years' experience in innovative start-up software companies.

CppCon 2025 Engineers Are Users Too: Case Study in Design Thinking for Infrastructure -- Grace Alwan

Registration is now open for CppCon 2025! The conference starts on September 13 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2025!

Engineers Are Users Too: A Case Study in Design Thinking for Infrastructure

Tuesday, September 16 15:15 - 16:15 MDT

by Grace Alwan

Summary of the talk:

Bringing together strong engineering skills with a foundation in UX Design can open unexpected doors—especially in fields like infrastructure, where there are few engineers trained in design. As a software engineer on an infrastructure team at a fintech company, I work on low-level systems that power how engineers manage compute at scale. But it’s my background in UX and human-computer interaction that’s made me an invaluable asset. By applying design thinking to infrastructure – through prototyping, user interviews, and iteration – I transformed a complex internal workflow and quickly became a subject matter expert.

This talk will walk you through that journey and give you the tools to be a design trailblazer in your own career. You'll leave with practical techniques for integrating empathy and user-centric thinking into deeply technical work—and insights on how expanding your skillset can accelerate your growth as a C++ or systems engineer.

Grace Alwan graduated from Stanford University in 2023, where she got her BS and MS in Computer Science specializing in Human-Computer Interaction. She is now a software engineer in the Technology Infrastructure org at Bloomberg, where she works on cluster and host management.

2025-09 Mailing Available

The 2025-09 mailing of new standards papers is now available.

 

WG21 Number Title Author Document Date Mailing Date Previous Version Subgroup
N5020 2026-11 Rio De Janeiro, Brazil Matheus Izvekov 2025-09-10 2025-09 All of WG21
P2953R2 Forbid defaulting operator=(X&&) && Arthur O'Dwyer 2025-09-02 2025-09 P2953R1 EWGI SG17: EWG Incubator
P3347R5 Invalid/Prospective Pointer Operations Paul E. McKenney 2025-08-27 2025-09 P3347R4 CWG Core
P3567R1 `flat_meow` Fixes Hui Xie 2025-09-06 2025-09 P3567R0 LWG Library
P3579R2 Fix matching of constant template parameters when matching template template parameters Matheus Izvekov 2025-09-10 2025-09 P3579R1 CWG Core
P3612R0 Harmonize proxy-reference operations (LWG 3638 and 4187) Arthur O'Dwyer 2025-09-02 2025-09 LWG Library
P3666r0 Bit-precise integers Jan Schultke 2025-09-11 2025-09 SG6 Numerics,SG22 Compatibility,EWG Evolution,LEWG Library Evolution
P3688R3 ASCII character utilities Jan Schultke 2025-09-09 2025-09 P3688R2 SG16 Unicode
P3695R1 Deprecate implicit conversions between Unicode character types Jan Schultke 2025-09-09 2025-09 P3695R0 SG16 Unicode,EWG Evolution
P3702R2 Stricter requirements for document submissions (SD-7) Jan Schultke 2025-09-10 2025-09 P3702R1 All of WG21
P3754R1 Slides for P3100R2 presentation to EWG Timur Doumler 2025-08-21 2025-09 P3754R0 EWG Evolution
P3776R0 More trailing commas Jan Schultke 2025-08-26 2025-09 EWG Evolution
P3776R1 More trailing commas Jan Schultke 2025-09-09 2025-09 P3776R0 EWG Evolution
P3784R1 range-if Michael Florian Hava 2025-09-10 2025-09 P3784R0 EWGI SG17: EWG Incubator
P3786R0 Tuple protocol for fixed-size spans Michael Florian Hava 2025-08-21 2025-09 LEWG Library Evolution
P3811R0 default comparison memory safety Jarrad J Waterloo 2025-08-15 2025-09 SG23 Safety and Security
P3812R0 const and & in default member functions Jarrad J Waterloo 2025-08-16 2025-09 EWG Evolution,CWG Core
P3813R0 execution::task::valueless() Michael Florian Hava 2025-09-10 2025-09 LEWG Library Evolution
P3815R0 Add scope_association concept to P3149 Jessica Wong 2025-09-01 2025-09 All of WG21
P3816R0 Hashing meta::info Matt Cummins 2025-09-01 2025-09 SG7 Reflection,LEWG Library Evolution,LWG Library,All of WG21
P3818R0 constexpr exception fix for potentially constant initialization Hana Dusíková 2025-08-31 2025-09 LEWG Library Evolution
P3818R1 constexpr exception fix for potentially constant initialization Hana Dusíková 2025-09-09 2025-09 P3818R0 LEWG Library Evolution
P3819R0 Remove evaluation_exception() from contract-violation handling for C++26 Peter Bindels 2025-09-05 2025-09 LEWG Library Evolution
P3820R0 Split constexpr uncaught_exceptions into distinct runtime and consteval functions Lénárd Szolnoki 2025-08-31 2025-09 LEWG Library Evolution
P3820R1 Fix constexpr uncaught_exceptions and current_exception Lénárd Szolnoki 2025-09-06 2025-09 P3820R0 LEWG Library Evolution
P3822R0 Conditional noexcept specifiers in compound requirements Viacheslav Luchkin 2025-09-01 2025-09 EWGI SG17: EWG Incubator,EWG Evolution
P3823R0 Wording for US NB comment 10 Arthur O'Dwyer 2025-09-10 2025-09 EWG Evolution
P3824R0 Static storage for braced initializers NBC examples Jarrad J Waterloo 2025-09-06 2025-09 SG23 Safety and Security,CWG Core
P3827R0 Wording for US NB comment 9 Arthur O'Dwyer 2025-09-10 2025-09 EWG Evolution
P3829R0 Contracts do not belong in the language David Chisnall 2025-09-03 2025-09 EWG Evolution,CWG Core,LWG Library
P3830R0 NB-Commenting is Not a Vehicle for Redesigning inplace_vector Nevin Liber 2025-09-03 2025-09 LEWG Library Evolution
P3831R0 Contract Labels Should Use Annotation Syntax Yihe Li 2025-09-06 2025-09 SG21 Contracts
P3832R0 Timed lock algorithms for multiple lockables Ted Lyngmo 2025-09-06 2025-09 LEWGI SG18: LEWG Incubator
P3834R0 Defaulting the Compound Assignment Operators Matthew Taylor 2025-09-10 2025-09 EWGI SG17: EWG Incubator
P3835R0 Contracts make C++ less safe -- full stop John Spicer 2025-09-08 2025-09 EWG Evolution,CWG Core,LWG Library
P3836R0 Make optional<T&> trivially copyable Jan Schultke 2025-09-11 2025-09 LEWG Library Evolution
P3838R0 Restoring Private Module Fragments Alisdair Meredith 2025-09-10 2025-09 CWG Core

Planning the next Meeting C++ job fairs

Meeting C++ is hosting a job fair in October online and planning a job fair in November in Berlin at Meeting C++ 2025!

Planning the next Meeting C++ job fairs

by Jens Weller

From the article:

The next Meeting C++ online job fair is planned for October 14th & 15th, also I'd like to talk about the onsite job fair plans for Meeting C++ 2025!

If you have open positions you should advertise them in the bi-weekly Meeting C++ Jobs Newsletter, which now also powers the candidate listing of Meeting C++ with 80+ international candidates at the moment.

 

Format your own type (Part 1) -- Sandor Dargo

SANDOR_DARGO_ROUND.JPGI recently published two posts about how C++26 improves std::format and the related facilities. (If you missed them, here are Part 1 and Part 2). Now it’s time to explore how you can format your own types using std::format.

Format your own type (Part 1)

by Sandor Dargo

From the article:

std::format was introduced in C++20 and is based on Victor Zverovich’s <fmt> library, which in turn was inspired by Python’s string formatting capabilities.

Let’s skip the fancy formatting options and simply see how to interpolate values using std::format.

#include <format>
#include <iostream>
#include <string>

int main() {
    std::string language{"C++"};
    int version{20};
    std::cout << std::format("{}{} is fun", language, version) << '\n';
}

/*
C++20 is fun
*/

That was easy.

Now imagine you want to print your own type. That won’t work by default.

CppCon 2025 Changing /std:c++14 to /std:c++20 - How Hard Could It Be? -- Keith Stockdale

Registration is now open for CppCon 2025! The conference starts on September 13 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2025!

Changing /std:c++14 to /std:c++20 - How Hard Could It Be?

Monday, September 15 15:15 - 16:15 MDT

by Keith Stockdale

Summary of the talk:

Rare put in huge amounts of work to bring Sea of Thieves to PlayStation 5 and to upgrade from the old XDK and UWP platforms to the new GDK platform. In this session, Rare will discuss why they made the decision to take this opportunity to also upgrade from C++14 to C++20. It shouldn’t be much harder than changing a 14 to a 20, right? How hard could it be?

Rare will discuss all the work that was involved in upgrading their language standard and share some anecdotes of some of the challenges that were met along the way. They will go through the benefits that they have felt from this upgrade along with some plans for continuing this work in the future.

Keith Stockdale is a Northern Irish senior software engineer who has been working on the Engine and Rendering teams at Rare Ltd for the last 8 years working on Sea of Thieves. At Rare, Keith's main areas of focus are involved in maintaining and creating general purpose simulations that run on the GPU. For example, he is the owner of the GPU particle system that drives the visual effects in Sea of Thieves. Keith is enthusiastic about promoting writing good quality code, whether it is running on the CPU on the GPU. He is driven towards ensuring that the code-bases he works in are enjoyable to work in for all current and future developers on his team.

C++ Day 2025

A full day of C++ in Pavia (Italy) on October 25:

C++ Day 2025

 

An event organized by the Italian C++ Community and SEA Vision.

Sponsors: SEA Vision, ELT, Sigeo (and others in the pipeline).

 

All talks will be in English.

 

In a nutshell

Launched in 2016, C++ Day is a community-driven event format by the Italian C++ Community, co-organized with external partners like companies and universities.

The C++ Day 2025 will be held in person on October 25 in Pavia, a joint effort between the Italian C++ Community and SEA Vision, who is also generously hosting the event at their venue.

The event is free to attend, runs for an entire day, and includes coffee breaks and lunch.

 

Who should attend the C++ Day 2025?

This event is made by passionate C++ professionals for C++ professionals, companies, students and enthusiasts.

 

What can I find at the C++ Day 2025?

  • tech talks
  • 2+ hours of networking
  • Some Sponsors on site
  • 2 coffee breaks and lunch included
  • Cozy atmosphere, games and gadgets

You can refer to the detailed program for more information.

 

When does the C++ Day 2025 take place?

The event will be held on October 25, 2025 at SEA Vision headquarters, in Pavia.

Open doors at 8.30 AM. The event starts at 9.15 AM and will last for a full day.

 

Who supports this event?

Sponsors: SEA Vision, ELT, Sigeo (and others in the pipeline).
 

Do I need to register?

The C++ Day 2025 is free, but you must register to facilitate the organization of the event. You can register here.