Tech News
← Home  ·  All topics

C++26

7 GoKawiil briefs on this topic · RSS for c++26

ISO C++ committee resolves C++26 contracts dispute, finishes standard a second time

At a six-day meeting in Búzios, Brazil, the ISO C++ committee completed a renewed round of technical work on C++26 after the standard's first approval ballot failed to pass unanimously. Most of the session addressed national-body comments concerning the contracts feature (pre, post, and contract_assert), resulting in an adopted extension and a documented rationale explaining the feature's development history. The committee will now reissue the updated C++26 document for a second international approval ballot.

C++26 fails ISO DIS ballot, delaying reflection and contracts features

The ISO DIS ballot for the C++26 standard closed on 23 October 2026 and was disapproved, according to C committee convenor Robert Seacord. He and WG21 Direction Group member Daveed Vandevoorde say no prior C++ standard draft has failed a ballot, or even received a single vote against. The disapproved draft includes reflection, std::execution, library hardening, and contracts, and the length of the resulting delay is not yet known.

C++26 adds std::polymorphic for value-semantic polymorphic composition

A follow-up article on C++26's std::indirect feature introduces std::polymorphic, a new standard library type aimed at building composite classes that own polymorphic member objects while remaining copyable, regular values. The piece illustrates the problem using a smart-house EventLog example, showing how existing approaches like storing a base class directly, using unique_ptr, or using std::variant each fail to cleanly support an open set of event types with proper value semantics.

C++26 adds standardized <debugging> header with breakpoint functions

The upcoming C++26 standard will include a new <debugging> header, defined via proposals P2546R5 and P2810R4 authored by Rene Ferdinand Rivera Morell. It provides three noexcept, freestanding functions: std::breakpoint(), std::is_debugger_present(), and std::breakpoint_if_debugging(), giving developers a portable way to trigger or detect debugger breakpoints without platform-specific macros.

C++26 proposal adds native pre/post contract syntax to functions

A technical walkthrough demonstrates how C++26 introduces built-in 'contracts' syntax, letting developers express function preconditions directly in a function's signature using pre(...), rather than relying on assert() calls buried inside the implementation. The example shows a get_value function checking that an index is within a vector's bounds, with the condition visible in both declaration and definition.

C++26 standard makes empty infinite loops well-defined behavior

The upcoming C++26 standard, via proposal P2809R3, changes the language so that trivial infinite loops like 'while(true);' are no longer undefined behavior. Previously, compilers such as Clang could legally assume such loops terminate and optimize them away entirely, sometimes causing code after the loop to execute unexpectedly. Because the fix was also accepted as a defect report, compiler vendors may backport it to earlier C++ standard modes too.

C++26 adds optional 'hardened' mode to catch standard library errors

C++26 introduces the concept of a hardened implementation for the standard library, where operations like std::vector's operator[] that previously caused undefined behavior on invalid access now trigger a defined contract violation instead—if the implementation enables hardening. The standard leaves it up to each implementation to decide whether and how this hardened mode is turned on.