So why was typedef bad?

Chris Wright via Digitalmars-d digitalmars-d at puremagic.com
Wed Aug 31 07:05:16 PDT 2016


On Wed, 31 Aug 2016 13:44:51 +0000, Ethan Watson wrote:

> http://dlang.org/deprecate.html#typedef
> 
> "typedef is not flexible enough to cover all use cases. This is better
> done with a library solution."
> 
> [Citation needed]
> 
> What use cases is it not flexible enough for?

Specifying the default value for the type. Making all typedefs from a 
base type implicitly convert to each other without warning unless you're 
careful, which should be a bug (the default discriminator should be 
__MODULE__ + __LINE__, and instead it's null).


More information about the Digitalmars-d mailing list