{"id":12572,"date":"2026-11-23T08:41:13","date_gmt":"2026-11-23T08:41:13","guid":{"rendered":"https:\/\/www.itwriting.com\/blog\/?p=12572"},"modified":"2026-11-23T08:41:36","modified_gmt":"2026-11-23T08:41:36","slug":"c-standards-committee-doubles-down-on-contracts-for-c-26","status":"publish","type":"post","link":"https:\/\/www.itwriting.com\/blog\/12572-c-standards-committee-doubles-down-on-contracts-for-c-26.html","title":{"rendered":"C++ standards committee doubles down on Contracts for C++ 26"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The WG21 ISO C++ committee has decided to keep the contentious Contracts feature in the language despite the previous submission being <a href=\"https:\/\/www.itwriting.com\/blog\/12560-c-in-crisis-following-disapproval-of-c-26.html\" data-type=\"link\" data-id=\"https:\/\/www.itwriting.com\/blog\/12560-c-in-crisis-following-disapproval-of-c-26.html\">disapproved<\/a> by the national bodies in a vote that is normally a formality.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Committee chair Herb Sutter reported that the &#8220;request by multiple comments to remove contracts from C++ 26&#8221; was not approved: &#8220;the committee discussed, revoted, and reaffirmed it wants to retain contracts in C++ 26.&#8221; The plan now is to resubmit an updated proposal to the national bodies for a second approval ballot.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Contracts feature has been amended to address some concerns from those opposed to its inclusion. In particular, a <a href=\"https:\/\/isocpp.org\/files\/papers\/P4451R2.pdf\" data-type=\"link\" data-id=\"https:\/\/isocpp.org\/files\/papers\/P4451R2.pdf\">paper<\/a> by Joshua Berne enabling enforcement of a contract assertion such that it &#8220;must not allow continuation past a violation&#8221; has been adopted as part of C++ 26. This was a feature that was intended but for C++ 29, which has now been brought forward, as some parties considered that Contracts could not be sensibly adopted without it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Berne has been working since 2019 on adding Contracts to C++. His paper on adding an always-enforced feature acknowledges that &#8220;there are obvious concerns that have prevented such an adoption before,&#8221; which he goes on to describe. Adopting the feature now is not his preferred option. An earlier paper, <a href=\"https:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2026\/p3400r5.pdf\" data-type=\"link\" data-id=\"https:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2026\/p3400r5.pdf\">P3400R5<\/a>, sets out what was planned for C++ 29 and the new feature is more or less a subset of this. The paper&#8217;s conclusion states that WG21 always knew that the initial release of Contracts was only a &#8220;solid foundation for a long and fruitful future of evolution&#8221; and that while the committee was confident in its original baseline release, &#8220;We are less certain of the wisdom of rushing a small part of what P3400R5 provides into C++26 for questionable reasons.&#8221; Berne added though that &#8220;adopting it early would certainly be a better option than holding up the entire Contracts facility.&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Sutter puts a positive spin on the outcome, noting that in March 2026 the WG21 committee was 90.5% in favour of the proposed C++ 26 standard, and now is 92.5% in favour. Close examination of the figures though shows that in March there were 12 opposed and 3 abstaining, and now 9 opposed and 8 abstaining, so even though opposition has reduced, the increased number of abstentions indicated continued uncertainty by a minority.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There is some risk here. The committee could have attempted to remove Contracts from C++ 26 with the intention of re-introducing the feature in C++ 29. This would almost certainly have passed a second ballot; but would also have been difficult to achieve as removing the feature is not a straightforward change. As it stands though, there is risk that the revised proposal will again fail, though one presumes that the committee is confident of a better outcome.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since the vote to disapprove, Contracts has been widely debated in the C++ community; there is a lack of consensus on the topic, trust has been lost, and the opposition of C++ inventor Bjarne Stroustrup is a key factor. This <a href=\"https:\/\/old.reddit.com\/r\/cpp\/comments\/1y1y10z\/c26_is_done_again_trip_report_november_2026_iso_c\/\" data-type=\"link\" data-id=\"https:\/\/old.reddit.com\/r\/cpp\/comments\/1y1y10z\/c26_is_done_again_trip_report_november_2026_iso_c\/\">Reddit thread<\/a> seems well-informed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The WG21 ISO C++ committee has decided to keep the contentious Contracts feature in the language despite the previous submission being disapproved by the national bodies in a vote that is normally a formality. Committee chair Herb Sutter reported that the &#8220;request by multiple comments to remove contracts from C++ 26&#8221; was not approved: &#8220;the &hellip; <a href=\"https:\/\/www.itwriting.com\/blog\/12572-c-standards-committee-doubles-down-on-contracts-for-c-26.html\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">C++ standards committee doubles down on Contracts for C++ 26<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,67,80,1519],"tags":[236,1644],"class_list":["post-12572","post","type-post","status-publish","format-standard","hentry","category-c","category-professional","category-software-development","category-tech","tag-c","tag-iso"],"_links":{"self":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/12572","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/comments?post=12572"}],"version-history":[{"count":2,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/12572\/revisions"}],"predecessor-version":[{"id":12574,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/12572\/revisions\/12574"}],"wp:attachment":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/media?parent=12572"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/categories?post=12572"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/tags?post=12572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}