169. WG21 Mailings, Contracts, C++ Ecosystem

With Gianluca Delfino, Frances Buontempo, Vladimír Arnošt, Mohamad ElKaissi, Mikhail Zborovski and others.

RedditLinkedIn

Media

Video

https://youtu.be/-G7HU_zOD6U

Podcast

https://redcircle.com/shows/0835997e-47ec-438e-b6ae-0b390966aa7e/episodes/6b3c0daa-bbe5-4390-8ee5-b007f403674e

Powered by RedCircle

CppOnline UK

Schedule

Rainer Grimm has ALS

Fundraising campaign

WG21 mailings

UFCS is a breaking change, of the absolutely worst kind

P3027R0 by Ville Voutilainen et al.

Enabling a multi-meaning for a member function call to also find and call non-member calls without changing the syntax of those calls is a terrible idea at such a level that words fail me.

C++ should be C++

P3023R1 by David Sankel

Discussed on Reddit

Introduction of std::hive to the standard library

P0447 R24, R25, R26

This is what determination looks like.

Do expressions

P2806R2

int x = do { do_return 42; };

Contracts on lambdas

P2890R2 by Timur Doumler

auto f = [] (int i)
    pre (i > 0)     // proposed; ill-formed in MVP
    post (r: r > i) // proposed; ill-formed in MVP
{
    contract_assert (s > 0); // already allowed in MVP
    return i + s;
};

C++20 Contracts did not allow pre and post on lambda expressions because it was using attribute syntax, and attributes could not be meaningfully applied to lambdas at the time.

The cited issue was later resolved by adopting P2173R1 for C++23, and is no longer relevant for the Contracts MVP because we are no longer using attribute syntax.

An Attribute-Like Syntax for Contracts

P2935R4 by Joshua Berne, 2023-11-05.

An Overview of Syntax Choices for Contracts

P3028R0 by Joshua Berne, Gašper Ažman, Rostislav Khlebnikov and Timur Doumler, 2023-11-05.

Attribute-like: 4 variants. Natural: single variant.

A natural syntax for Contracts

P2961R2 by Timur Doumler and Jens Maurer, 2023-11-08.

Constant evaluation of Contracts

P2894R1 by Timur Doumler

One of these design holes is the question of how contract annotations should behave during constant evaluation.

Whether contracts are checked during constant evaluation should be implementation-defined, allowing implementations to offer both options, e.g. through compiler flags.

The only difference is that constant evaluation has no compile-time analogue for installing a user-defined contract-violation handler: as a user-replaceable function that is added at link time, a user-defined contract-violation handler is inherently a runtime-only feature.

std::quantity as a numeric type

P2982R1 by Mateusz Pusz and Chip Hogg

Reflection for C++26

P2996R1 now has Godbolt links for examples, using EDG experimental implementation.

constexpr std::shared_ptr

P3037R0 by Paul Keir

Adding an Undefined Behavior and IFNDR Annex

P3075R0 by Shafik Yaghmour.

Looks like this is a "how" paper to the initial "why" paper P1705R0.

The C++ Ecosystem in 2023

JetBrains blog post

Juusi Pakkanen on modules

Paraphrasing Reddit: Not great, not terrible.

std::print in C++23

Viktor Zverovich

Reddit

#include <print>

int main()
{
  std::print("Hello, world!\n");
  std::print("{:d}", "I am not a number"); // compile error
  std::print("你好{}!\n", "世界");
}

10x Editor

10x Editor Website

An editor for 10x developers at last! But seriously, looks very nice and capable. Pity it’s Windows-only for the time being. Also, not sure how their pitch works against all the free and paid C++ IDEs available.

https://youtu.be/fH80sofUS7o

Personal licence: £8/month or £80/year

Quote

https://mastodon.social/@programming_quotes/111754187177420252

A computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are, in short, a perfect match.

Unknown