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

Walter Bright newshound2 at digitalmars.com
Tue Nov 2 01:03:42 UTC 2021


On 11/1/2021 3:07 PM, Paul Backus wrote:
> 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

That's the "return-scope-ref" ambiguity problem. I've put through a series of 
PRs to correct that. It's almost done. The underlying type system is correct, 
it's a syntactical issue.


More information about the Digitalmars-d mailing list