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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jul 4 18:59:59 PDT 2010


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

           Summary: __traits should have isFunction, isVariable, etc
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: jmdavisProg at gmail.com


--- Comment #0 from Jonathan M Davis <jmdavisProg at gmail.com> 2010-07-04 18:59:56 PDT ---
At present, __traits has some nice stuff that will let you check things like
whether a function is abstract, or whether something is of an integral type. It
will even let you get all of the member functions and variables of a class.
However, there is no way at present (as far as I can tell) to determine whether
something is a function or a variable. There isn't a way to determine if
something is a type either, let alone whether it's a class, struct, array, or
scalar type. Most of what's there seems to be to ask about the attributes of a
particular expression, variable, or type rather than telling you what it _is_.
In particular, I think that we need these __traits:

isArray
isClass
isFunction
isStruct
isType
isVariable

-- 
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