alt.hn

4/19/2026 at 9:00:49 PM

C++26: Reflection, Memory Safety, Contracts, and a New Async Model

https://www.infoq.com/news/2026/04/cpp-26-reflection-safety-async/

by birdculture

4/20/2026 at 1:49:27 AM

Very cool stuff, excited to see some progress into memory safety for c++ but jeez. As i understand it, it requires me to do some meta programming to build guards around my program and ensure memory safety? Is that accurate or am I missing the mark here

by vsgherzi

4/20/2026 at 7:17:13 AM

No, it's just that there's now a hardened version of the standard library that does bound checks at runtime.

Compile-time reflection is an entirely different feature and has nothing to do with memory safety.

The article also mentions contracts that can be used to validate pre- and postconditions of function calls.

by spacechild1

4/19/2026 at 11:11:36 PM

The class(metaclass) {...} syntax is not part of C++ yet. It is part of a proposal targeted for C++29.

by HeliumHydride

4/19/2026 at 11:28:02 PM

Right, metaclass is a ways off. But even without it, just the core reflection is going to save a ton of boilerplate. Half the template tricks I've written for message parsing were basically hand-rolling what `^T` will just give you.

by nulltrace