Remix.run Logo
▲ uhuaua 21 hours ago

If C++ adds pattern matching, and it works in practical usage across projects, will the C ecosystem consider adding some kind of pattern matching, perhaps inspired by what comes into C++, perhaps not?

Also, a question for a C expert like you, uecker: In your opinion, does the compound literals feature have complex lifetimes rules or complex semantic rules otherwise?

▲uecker 4 hours ago | parent [-]

Personally, I would like to have pattern matching, but I think we need some other features first. I am usually a bit scared about what C++ comes up with.

I am not sure I understand the second question. I do not think compound literals have complex lifetime rules. The lifetime end with the corresponding block, as do other objects in C (one needs to know what a block is, some people confuse this with scope). There is some potential issue which may be surprising when passing them to macros that make use of the statement expression extension, as the lifetime is then limited to the macro body.