• C++26 failed its DIS ballot.

    From ram@ram@zedat.fu-berlin.de (Stefan Ram) to comp.lang.c++ on Mon Oct 26 14:03:20 2026
    From Newsgroup: comp.lang.c++

    According to reports in the World-Wide Web,
    C++26 failed its DIS ballot. Maybe related
    to contracts.


    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From David Brown@david.brown@hesbynett.no to comp.lang.c++ on Mon Oct 26 15:19:08 2026
    From Newsgroup: comp.lang.c++

    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.


    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Oodini@svdbg@free.fr to comp.lang.c++ on Fri Nov 6 23:47:47 2026
    From Newsgroup: comp.lang.c++

    Le 26/10/2026 |a 15:19, David Brown a |-crit-a:

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

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Chris M. Thomasson@chris.m.thomasson.1@gmail.com to comp.lang.c++ on Fri Nov 6 19:49:47 2026
    From Newsgroup: comp.lang.c++

    On 11/6/2026 2:47 PM, Oodini wrote:
    Le 26/10/2026 |a 15:19, David Brown a |-crit-a:

    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.-a 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?
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Oodini@svdbg@free.fr to comp.lang.c++ on Sat Nov 7 08:28:15 2026
    From Newsgroup: comp.lang.c++

    Le 07/11/2026 |a 04:49, Chris M. Thomasson a |-crit-a:

    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.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From David Brown@david.brown@hesbynett.no to comp.lang.c++ on Sat Nov 7 12:58:27 2026
    From Newsgroup: comp.lang.c++

    On 06/11/2026 23:47, Oodini wrote:
    Le 26/10/2026 |a 15:19, David Brown a |-crit-a:

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

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Tristan Wibberley@tristan.wibberley+netnews2@alumni.manchester.ac.uk to comp.lang.c++ on Sat Nov 14 20:22:52 2026
    From Newsgroup: comp.lang.c++

    On 07/11/2026 03:49, Chris M. Thomasson wrote:
    On 11/6/2026 2:47 PM, Oodini wrote:
    Le 26/10/2026 |a 15:19, David Brown a |-crit-a:

    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.-a 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.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Chris M. Thomasson@chris.m.thomasson.1@gmail.com to comp.lang.c++ on Sat Nov 14 22:47:49 2026
    From Newsgroup: comp.lang.c++

    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 |a 15:19, David Brown a |-crit-a:

    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.-a 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.
    --- Synchronet 3.22a-Linux NewsLink 1.2