[Issue 8388] New: std.traits.MemberFunctionsTuple doesn't work with constructors or destructors

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 13 22:52:10 PDT 2012


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

           Summary: std.traits.MemberFunctionsTuple doesn't work with
                    constructors or destructors
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: jmdavisProg at gmx.com


--- Comment #0 from Jonathan M Davis <jmdavisProg at gmx.com> 2012-07-13 22:52:08 PDT ---
This code

import std.stdio;
import std.traits;

class C
{
    this() {}
    this(int i) {}
    this(int i, float j) {}
    this(string s) {}

    ~this() {}
}

void main()
{
    writeln(__traits(hasMember, C, "__ctor"));
    writeln(__traits(hasMember, C, "__dtor"));

    foreach(f; MemberFunctionsTuple!(C, "__ctor"))
        writeln(f.stringof);

    foreach(f; MemberFunctionsTuple!(C, "__dtor"))
        writeln(f.stringof);
}


prints

true
true

The MemberFunctionsTuple results are empty. The constructors and destructor
should be listed, but none are. So, clearly, while hasMember properly finds the
constructors and destructor, MemberFunctionsTuple does not.

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