3 comments

  • zarzavat19 minutes ago
    I have no particular opinion on contracts per se, but I do think that the C++ committee is procrastinating by focusing on niche features like contracts instead of dealing with the urgent issues (namely packaging and memory safety) where C++ is losing to Rust.<p>The rejection was a moment for them to reevaluate their priorities but it doesn&#x27;t seem that they&#x27;ve gotten the message.
    • guipsp11 minutes ago
      Contracts are part of the memory safety story in c++
      • edflsafoiewq7 minutes ago
        How?
        • horseloverthin1 minute ago
          A good way to think about contracts and related features as they relate to memory safety is from the compilers perspective; pretty much any feature that gives the compiler additional information about a users intent for a scope allows the compiler to have to infer less, and thus have more ability to provide &#x27;safety&#x27; guarantees.<p>The most trivial example of this is a check that a caller has provided non-null inputs ( hence allowing &#x27;safe&#x27; unchecked access in most cases)
  • grg022 minutes ago
    &gt; pre&lt;std::contracts::controls::enforced&gt;(x &gt; 0)<p>Ho-lee, guys. We just needed pre(x &gt; 0)
    • andrewjf17 minutes ago
      Yeah but why wouldn&#x27;t &quot;x&quot; be a type that could only represent positive integers?
      • grg013 minutes ago
        I would like Ada-style integer types too, but I don&#x27;t strictly know how those are implemented. Are you suggesting invariants should also be given at the type level?
      • kevin_thibedeau13 minutes ago
        They really should just copy Ada rather than this whizbangery.
  • npalli22 minutes ago
    LOL. The C++26 gloom and doom last month was something else. C++ was finished (not just C++26, mind you), and everyone should pack their bags and move to Rust.<p>Meanwhile, back in reality, the committee did its job: it addressed the NB comments, kept contracts, and C++26 is back on track. Imagine that.