[Issue 4427] __traits should have isFunction, isVariable, etc

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 16 14:07:16 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=4427


Rob T <alanb at ucora.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alanb at ucora.com


--- Comment #6 from Rob T <alanb at ucora.com> 2012-11-16 14:07:14 PST ---
(In reply to comment #2)
> Good points, though would == function check when it was a function pointer
> rather than a function? In either case, I think that you should be able to
> check these in a consistent manner, which you can't do right now. With things
> spread out between built-in constructs, __traits, and std.traits, it can be a
> bit of a mess to figure out how to do something with compile-time reflection.
> Even if something like isType were simply translated to is(T), I think that
> having it would still be quite valuable since it would make the various
> compile-time reflection facilities more consistent and uniform.

I wasted an hour on this very issue because it's not obvious in the least how
to do something like isStruct() for a template constraint.

I don't mind using is( T == struct ), so long how to do such a thing (and other
tests) is documented in an obvious place that someone is going to look at, like
in the templates constraint section. That section currently has nothing in it
of much help other than showing how to constrain a few basic types.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list