Library Typedefs are fundamentally broken

Jakob Ovrum via Digitalmars-d digitalmars-d at puremagic.com
Tue Sep 16 20:08:44 PDT 2014


On Wednesday, 17 September 2014 at 02:57:03 UTC, Freddy wrote:
> When you have separate 2 typedefs of the exact same type, they
> are equal.While this maybe able to be solved with
> Typedef!(Typedef!(...)) different modules typedef ing the same
> type (most likely build-in types) would have their typedef be
> equivalent thereby degrading the purpose of typedef.
> ---
> import std.typecons;
>
> alias meter = Typedef!float;
> alias feet = Typedef!float;
> static assert(!is(meter==feet));
> ---
> Your thoughts?

`Typedef` takes a second argument that can make it unique. It's 
all in the docs.


More information about the Digitalmars-d mailing list