[Issue 9065] New: Please consider adding these std.traits

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 23 06:06:02 PST 2012


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

           Summary: Please consider adding these std.traits
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: turkeyman at gmail.com


--- Comment #0 from Manu <turkeyman at gmail.com> 2012-11-23 06:06:00 PST ---
I'm constantly writing static logic code where I have no real idea what I'm
really doing, and when I finally get it working, it's unreadable.
This usually involves lots of careful is()-ing and __traits-ing.

I'd really appreciate these templates added to std.traits:

Tell me if T is a variable; ie, has a value, has an address (not an enum), ...
template isVariable(alias T) { ... }

Tell me if T is a function definition, not just if I can call it. I can easily
find if something is a function pointer/delegate, or a method, or virtual, or
abstract, or various other function related details, but surprisingly, not if T
is just a function definition or not.
template isFunctionDefinition(alias T) { ... }

I want to know if I is an instance of some template T.
template isInstanceOf(alias T, I) { ... }

Perhaps like this: http://dpaste.dzfl.pl/fedac944

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