std.traits vcs __traits

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Tue Jan 17 09:00:03 PST 2017


On Tuesday, January 17, 2017 11:17:10 QAston via Digitalmars-d wrote:
> On Monday, 16 January 2017 at 19:45:33 UTC, Jonathan M Davis
>
> wrote:
> > I can see that as an argument not to add something that it's in
> > std.traits to __traits or why something should be added to
> > std.traits rather than __traits, but if something already
> > exists with __traits, why duplicate that logic in std.traits?
> > It seems like it complicates std.traits for no benefit as well
> > as risking having the behavior of  __traits and std.traits
> > differ, which could cause confusion and bugs.
> >
> > - Jonathan M Davis
>
> Why? Because working with introspection in D requires constantly
> switching between at least 4 different documentation pages to
> find the introspection you're interested in.

That's completely unaffected by whether a trait in std.traits uses something
from __traits or whether it implements it on its own. It is affected by
whether something is in __traits or std.traits, but that's not the question
here. What Nordlow is looking to do is make existing traits in std.traits
use the corresponding __traits where they already exist rather than having a
separate implementation. It's entirely an implementation detail.

- Jonathan M Davis



More information about the Digitalmars-d mailing list