🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

8 total messages Started by Stefan Ram Mon, 26 Oct 2026 14:03
C++26 failed its DIS ballot.
#603
Author: Stefan Ram
Date: Mon, 26 Oct 2026 14:03
5 lines
1506 bytes
  According to reports in the World-Wide Web,
  C++26 failed its DIS ballot. Maybe related
  to contracts.

Re: C++26 failed its DIS ballot.
#604
Author: David Brown
Date: Mon, 26 Oct 2026 14:19
26 lines
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.

Re: C++26 failed its DIS ballot.
#775
Author: Oodini
Date: Fri, 06 Nov 2026 22:47
11 lines
1603 bytes
Le 26/10/2026 à 15:19, David Brown a écrit :

> 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.

OK, you can point the client as guilty. But that may make your debugging 
session more difficult, because you don't know if the client will 
actually check the preconditions.
Re: C++26 failed its DIS ballot.
#779
Author: Chris M. Thomasson
Date: Sat, 07 Nov 2026 03:49
14 lines
1952 bytes
On 11/6/2026 2:47 PM, Oodini wrote:
> Le 26/10/2026 à 15:19, David Brown a écrit :
> 
>> 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.
> 
> OK, you can point the client as guilty. But that may make your debugging 
> session more difficult, because you don't know if the client will 
> actually check the preconditions.
> 

The caller needs to know how to properly use an API, right?
Re: C++26 failed its DIS ballot.
#780
Author: Oodini
Date: Sat, 07 Nov 2026 07:28
10 lines
1540 bytes
Le 07/11/2026 à 04:49, Chris M. Thomasson a écrit :

> The caller needs to know how to properly use an API, right?

The contracts may also be defined inside your own software, and your 
client is your own team. And you want to know contracts violations as 
soon as possible.

Also, if your precpnditions are only in the documentation, there is a 
risk your preconditions don't reflect anymore what the code expects.
Re: C++26 failed its DIS ballot.
#784
Author: David Brown
Date: Sat, 07 Nov 2026 11:58
20 lines
2282 bytes
On 06/11/2026 23:47, Oodini wrote:
> Le 26/10/2026 à 15:19, David Brown a écrit :
> 
>> 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.
> 
> OK, you can point the client as guilty. But that may make your debugging 
> session more difficult, because you don't know if the client will 
> actually check the preconditions.
> 

If you don't trust the caller code (such as at API or security 
boundaries), the callee code can check the preconditions as well.  But 
generally debugging is easiest when you catch the bug as soon as 
possible (preferably at compile time, or static analysis time - failing 
that, as soon as practical at runtime).  A failed precondition is a bug 
in client code, so that's where you need to look.
Re: C++26 failed its DIS ballot.
#860
Author: Tristan Wibberley
Date: Sat, 14 Nov 2026 20:22
30 lines
2703 bytes
On 07/11/2026 03:49, Chris M. Thomasson wrote:
> On 11/6/2026 2:47 PM, Oodini wrote:
>> Le 26/10/2026 à 15:19, David Brown a écrit :
>>
>>> 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.
>>
>> OK, you can point the client as guilty. But that may make your
>> debugging session more difficult, because you don't know if the client
>> will actually check the preconditions.
>>
> 
> The caller needs to know how to properly use an API, right?

No the author of the caller does.

-- 
Tristan Wibberley

The message body is Copyright (C) 2026 Tristan Wibberley except
citations and quotations noted. All Rights Reserved except that you may,
of course, cite it academically giving credit to me, distribute it
verbatim as part of a usenet system or its archives, and use it to
promote my greatness and general superiority without misrepresentation
of my opinions other than my opinion of my greatness and general
superiority which you _may_ misrepresent. You definitely MAY NOT train
any production AI system with it but you may train experimental AI that
will only be used for evaluation of the AI methods it implements.
Re: C++26 failed its DIS ballot.
#870
Author: Chris M. Thomasson
Date: Sun, 15 Nov 2026 06:47
21 lines
2190 bytes
On 11/14/2026 12:22 PM, Tristan Wibberley wrote:
> On 07/11/2026 03:49, Chris M. Thomasson wrote:
>> On 11/6/2026 2:47 PM, Oodini wrote:
>>> Le 26/10/2026 à 15:19, David Brown a écrit :
>>>
>>>> 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.
>>>
>>> OK, you can point the client as guilty. But that may make your
>>> debugging session more difficult, because you don't know if the client
>>> will actually check the preconditions.
>>>
>>
>> The caller needs to know how to properly use an API, right?
> 
> No the author of the caller does.
> 

;^D The calling code should adhere to the API.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads