www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6852] New: Cannot compare instances of ParameterStorageClassTuple

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6852

           Summary: Cannot compare instances of ParameterStorageClassTuple
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com



09:43:42 PDT ---
import std.traits;

void test(T1, T2)(T1 t1, T2 t2)
{
    alias ParameterTypeTuple Types;
    static assert(is(Types!T1 == Types!T2));  // ok

    alias ParameterStorageClassTuple Stores;    
    static assert(Stores!(t1) == Stores!(t2)); // NG
    static assert(Stores!T1 == Stores!T2);     // NG
    static assert(is(Stores!t1 == Stores!t2)); // NG
    static assert(is(Stores!T1 == Stores!T2)); // NG
}

void main()
{
    test( (int){},
          (int){});
}

What gives? ParameterTypeTuple doesn't suffer from these issues. It seems it's
impossible to compare equality of storage classes between two functions. :s

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 25 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6852




09:47:55 PDT ---
Funky workaround:

alias Stores!T1 x;
alias Stores!T2 y;
static assert(x.stringof == y.stringof);

Boo!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 25 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6852


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
           Platform|Other                       |All
         Resolution|                            |FIXED
         OS/Version|Windows                     |All




 What gives? ParameterTypeTuple doesn't suffer from these issues. It seems it's
 impossible to compare equality of storage classes between two functions. :s
ParameterStorageClassTuple makes a tuple of values, so
     alias ParameterStorageClassTuple Stores;    

     static assert(Stores!(t1) == Stores!(t2)); // NG
     static assert(Stores!T1 == Stores!T2);     // NG
value comparison would work, but
     static assert(is(Stores!t1 == Stores!t2)); // NG
     static assert(is(Stores!T1 == Stores!T2)); // NG
type comparison would not work. From 2.063, value tuple comparison would work by fixing issue 9873. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 04 2013