partiallyQualifiedName?

Stefan Koch uplink.coder at googlemail.com
Tue Oct 17 06:37:34 UTC 2017


On Monday, 16 October 2017 at 23:56:00 UTC, Nicholas Wilson wrote:
> using fullyQualifiedName [here]
> (https://github.com/libmir/dcompute/blob/master/source/dcompute/driver/ocl/util.d#L120)
> leads to a large compilation slowdown, but I only need it to 
> disambiguate up to the module level i.e. so that
>
> struct Context
> {
>     enum Properties {}
>     static struct Info
>     {
>         @(0) Properties p; // <---
>     }
> }
>
> ...
> partiallyQualifiedName!p
> ...
>
> resolves to Context.Properties instead of 
> dcompute.driver.ocl.context.Context.Properties, thus avoiding 
> many template instantiations.
>
>  Alas typeof(p).stringof, which yields Properties, errors "No 
> such identifier Properties" (and subsequently crashes the CTFE 
> engine).
>
> I tried looking at the fullyQualifiedName but got lost pretty 
> quick.
>
> Thanks
> Nic
This should really be done via a __trait. Otherwise it does not 
scale.



More information about the Digitalmars-d-learn mailing list