Library Typedefs are fundamentally broken

Marco Leise via Digitalmars-d digitalmars-d at puremagic.com
Fri Sep 19 23:36:04 PDT 2014


Am Fri, 19 Sep 2014 08:02:30 -0700
schrieb Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org>:

> On 9/18/14, 11:45 PM, Marco Leise wrote:
> > We should probably revert to having real typedefs.
> 
> Should not.

Ok, but don't ask me to use
  alias ALfloat = std.typecons.Typedef!(float, "yummyCookie23");
when it could be
  typedef ALfloat = float;
! :)

> > I find myself not using Typedef either. Instead I use wrapper
> > structs with alias this, because they fit the shoe much better
> > by introducing a unique symbol in a straight forward way :)
> >
> > Rationale
> >
> > Typedef is not flexible enough to cover all use cases.
> > This is better done with a language solution.
> 
> What's missing?
> 
> 
> Andrei

That was more of a pun on the original deprecation rationale:
  "typedef is not flexible enough to cover all use cases.
   This is better done with a library solution."
Frankly though it seems like templates are the improper tool
to create new unique symbols when at the same time we more or
less depend on templates only being instantiated once for the
same arguments.

-- 
Marco



More information about the Digitalmars-d mailing list