Herb Sutter's CppCon talk "Extending and Simplifying C++: Thoughts on Pattern Matching using `is` and `as`"

Paul Backus snarwin at gmail.com
Mon Nov 1 22:07:38 UTC 2021


On Monday, 1 November 2021 at 22:02:26 UTC, Andrei Alexandrescu 
wrote:
> On 2021-11-01 17:41, Walter Bright wrote:
>> 4. The way scope & return & ref apply to types is completely 
>> consistent. This enables me to advise that when people have 
>> problems understanding it, to rewrite their example code in 
>> terms of raw pointers, as it will behave the same.
>
> I very much wish this is true and useful.

It's true, as far as it goes. `return` and `scope` are consistent 
in the way they apply to *types*.

However, `ref` is not part of the type system--and when you add 
`ref` into the mix, that's when you start to see the special 
cases cropping up (see e.g. [Dennis's thread on the inconsistency 
of `return scope`][1]).

[1]: 
https://forum.dlang.org/thread/nbbtdbgifaurxoknyeuu@forum.dlang.org


More information about the Digitalmars-d mailing list