shared and getParameterStorageClasses bug?
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Sun Aug 23 19:15:40 UTC 2020
On 8/23/20 10:21 AM, Paul Backus wrote:
> On Sunday, 23 August 2020 at 14:11:21 UTC, Jean-Louis Leroy wrote:
>>
>> OK since the `shared` has migrated to the type, isSharedParameter can
>> be written like this:
>>
>> enum isSharedParameter(alias fun, uint param) =
>> is(Parameters!fun[param] == SharedOf!(Parameters!fun[param]));
>
> An even simpler way is to use the pattern-matching feature of `is(...)`:
>
> enum isSharedParameter(alias fun, size_t param) =
> is(Parameters!fun[param] == shared(T), T);
>
> You can read this as, "there exists some T such that
> Parameters!fun[param] is shared(T)".
This would have problems if shared is combined with other qualifiers
(const and my nemesis inout).
More information about the Digitalmars-d
mailing list