Article View: comp.lang.c++
Article #604Re: C++26 failed its DIS ballot.
From: David Brown
Date: Mon, 26 Oct 2026 14:19
Date: Mon, 26 Oct 2026 14:19
26 lines
2454 bytes
2454 bytes
On 26/10/2026 15:03, Stefan Ram wrote: > According to reports in the World-Wide Web, > C++26 failed its DIS ballot. Maybe related > to contracts. > If you find more details, it would be nice to hear them. I personally am disappointed in the way C++ contracts will work. It appears to be too much an all-or-nothing approach for policies, often puts the checks in the wrong place, and does not allow compilers to assume that contracts are followed in order to optimise code. To me, it seems obvious that it is up to the caller code to make sure the preconditions are fulfilled - checking must therefore be on the caller side, not the callee side. If the precondition fails, the bug is in the caller code. In the implementation of the function, the compiler should be able to assume the precondition is true for optimisation purposes. Similarly, any checking of postconditions should be on the callee side, while the caller can assume the conditions hold. You might want to have extra doubled-up checks at some points, such as major API boundaries or when dealing with code that is not well tested or fully trusted.
Technical Details
Message-ID:
<11bnngs$k5tu$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<failure-20261026130433@ram.dialup.fu-berlin.de>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: David Brown <david.brown@hesbynett.no> Newsgroups: comp.lang.c++ Subject: Re: C++26 failed its DIS ballot. Date: Mon, 26 Oct 2026 15:19:08 +0100 Organization: A noiseless patient Spider Lines: 26 Message-ID: <11bnngs$k5tu$1@dont-email.me> References: <failure-20261026130433@ram.dialup.fu-berlin.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 26 Oct 2026 14:19:09 +0000 (UTC) Injection-Info: dont-email.me; logging-data="661438"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19C+z0O40A/Q2R3eDLD5toxC9+0dn0KtzE="; posting-host="ec2304906568c12ad34d75592b79e87e" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:ZHierkdiCaJNqkBsJBt9WBNJiAI= sha256:ZkfxKtt0RCncSB+44nrhwjq7Nqvpouxt1TnlvXduUlQ= sha1:7m5/GcO9/7NPJl/tqlBUBn8MsIQ= sha256:P+UC4QHWhe+TvH4J8Cxg0v0uUz4bhImRvgDzf3ep34E= Content-Language: en-GB, nb-NO In-Reply-To: <failure-20261026130433@ram.dialup.fu-berlin.de>