enums and std.traits

Jonathan M Davis jmdavisProg at gmx.com
Sat Aug 4 21:09:11 PDT 2012


On Sunday, August 05, 2012 05:40:40 Adam D. Ruppe wrote:
> On Saturday, 4 August 2012 at 21:09:40 UTC, Jonathan M Davis
> 
> wrote:
> > I think that the change to std.traits was a big mistake and
> > will probably file it as a regression
> 
> I don't know what the right answer here is, but if you do end up
> reverting those changes, be sure to change std.conv.to too so
> that bug which led to this change doesn't come back.
> 
> Probably adding is(T == enum) and !is(T==enum) to the appropriate
> places will do the trick.

Oh. Definitely. And if the appropriate unit tests are there (as they should 
be), then changing isSomeString should actually break them until those 
functions are fixed to take the isSomeString changes into account. But I'd much 
rather have the rare function which cares about differentiating between enums 
and their base types (e.g. std.conv.to) checks for that itself that make every 
function which doesn't care do the checking.

- Jonathan M Davis


More information about the Digitalmars-d mailing list