[Issue 4239] Mixed tuple comparison

2017-08-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4239

RazvanN  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||razvan.nitu1...@gmail.com
 Resolution|--- |WONTFIX

--- Comment #4 from RazvanN  ---
This issue is very old and I don't think that there is much need for this
feature. Closing as WONTFIX, reopen if the need for this is proven.

--


[Issue 4239] Mixed tuple comparison

2015-06-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4239

Andrei Alexandrescu and...@erdani.com changed:

   What|Removed |Added

Version|future  |D2

--


[Issue 4239] Mixed tuple comparison

2010-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4239


nfx...@gmail.com changed:

   What|Removed |Added

 Depends on||3279


--- Comment #3 from nfx...@gmail.com 2010-05-30 08:36:20 PDT ---
Bug 3279 is the reason why the obvious idea to implement this fails.

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


[Issue 4239] Mixed tuple comparison

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4239


nfx...@gmail.com changed:

   What|Removed |Added

 CC||nfx...@gmail.com


--- Comment #1 from nfx...@gmail.com 2010-05-26 14:58:55 PDT ---
This seems to work fine:

struct X(T...) { }

static assert(is(X!(int, int) == X!(int, int)));
static assert(is(X!(int, foo) == X!(int, foo)));
static assert(!is(X!(int, foo) == X!(foo, int)));

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


[Issue 4239] Mixed tuple comparison

2010-05-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4239



--- Comment #2 from Simen Kjaeraas simen.kja...@gmail.com 2010-05-26 15:20:55 
PDT ---
(In reply to comment #1)
 This seems to work fine:
 
 struct X(T...) { }
 
 static assert(is(X!(int, int) == X!(int, int)));
 static assert(is(X!(int, foo) == X!(int, foo)));
 static assert(!is(X!(int, foo) == X!(foo, int)));

Indeed it does. I do however still feel it should be included in Phobos as
something more obvious.
Simplified version, with newly acquired knowledge:

/**
Compares tuples that might contain a mixture of types and values.

Example:

static assert(SameTuple!(int, int).As!(int, int));
static assert(SameTuple!(int, foo).As!(int, foo));
static assert(!SameTuple!(int, foo).As!(foo, int));

 */

struct SameTupleImpl(T...) {
}

template SameTuple(T...) {
template As(U...) {
enum As = is( SameTupleImpl!T == SameTupleImpl!U );
}
}

unittest {
static assert(SameTuple!(int, int).As!(int, int));
static assert(SameTuple!(float).As!(float));
static assert(SameTuple!(foo).As!(foo));
static assert(!SameTuple!(foo).As!(bar));
static assert(!SameTuple!(int ).As!(bar));
static assert(!SameTuple!(int ).As!(float));
static assert(SameTuple!(int, foo).As!(int, foo));
static assert(!SameTuple!(int, foo).As!(foo, int));
static assert(SameTuple!().As!());
static assert(!SameTuple!(int).As!());
static assert(!SameTuple!().As!(int));
static assert(!SameTuple!(foo).As!());
static assert(!SameTuple!().As!(foo));
}

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