cast(function qualifier)
Paul Backus
snarwin at gmail.com
Mon Feb 17 14:44:05 UTC 2025
On Monday, 17 February 2025 at 11:26:59 UTC, Quirin Schroll wrote:
> On Saturday, 15 February 2025 at 13:28:38 UTC, Paul Backus
> wrote:
>> I understand where you're coming from but unfortunately the
>> result looks like line noise.
>
> Remember that you generally won’t do this too often anyway.
The problem isn't that it's annoying to type, it's that it makes
the resulting code unreadable. Every single time I run into this
reading code, I'm going to have to pull up the relevant part of
the language spec to figure out what the hell it's doing.
>> ```d
>> alias Dg = typeof(dg);
>> cast(Unshared!Dg) dg; // inout void delegate() const @safe
>> cast(UnconstContext!Dg) dg; // inout shared void delegate()
>> @safe
>> cast(Unsafe!Dg) dg; // inout shared void delegate() const
>> cast(Impure!Dg) dg; // inout shared void delegate() const @safe
>> cast(Pure!(Nothrow!Dg)) dg; // const inout shared void
>> delegate() const nothrow pure @safe
>> ```
>
> This is template instantiation hell.
This is a non-argument. What *specifically* is the negative
consequence of template instantiation in this context?
More information about the dip.ideas
mailing list