The worst Phobos template (in binderoo)
Stefan Koch via Digitalmars-d
digitalmars-d at puremagic.com
Thu Sep 29 07:49:03 PDT 2016
On Thursday, 29 September 2016 at 13:58:44 UTC, Eugene Wissner
wrote:
> On Wednesday, 14 September 2016 at 20:28:13 UTC, Stefan Koch
> wrote:
>> On Wednesday, 14 September 2016 at 20:24:13 UTC, Stefan Koch
>> wrote:
>>
>>> I would like to see users of fullyQualifiedName because apart
>>> from binderoo code which seems to work, I have none.
>>
>> That was supposed to say : I would like to see [test cases
>> from] users of fullyQulifiedName.
>
> Any chance to get this one working:
>
> import std.typecons;
>
> enum Stuff
> {
> asdf,
> }
>
> void main()
> {
> BitFlags!Stuff a;
> mixin(__traits(fullyQualifiedName, typeof(a)) ~ " c;");
> }
>
> ?
>
> Btw __traits(fullyQualifiedName, typeof(a)) generates:
> std.typecons.BitFlags!(Stuff, cast(Flag)false)
>
> std.traits.fullyQualifiedName generates:
> std.typecons.BitFlags!(fqn.Stuff, cast(Flag)false)
>
>
> ("fqn" is the name of the executable)
The reason why this fails is because of the cast(Flag) which
should be cast(Flag!"unsafe").
I can probably make it work tough,
that means more special casing :)
More information about the Digitalmars-d
mailing list