This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/35480] Relational operators for <tr1/tuple> don't error on different sized tuples
- From: "chris at bubblescope dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Mar 2008 17:11:06 -0000
- Subject: [Bug libstdc++/35480] Relational operators for <tr1/tuple> don't error on different sized tuples
- References: <bug-35480-15866@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from chris at bubblescope dot net 2008-03-06 17:11 -------
While I agree that this is an issue of implementation detail, I thought there
was code already there to stop this case, except it is broken :(
Looking at the svn copy of tr1/tuple, you can see operator== (and others)
delegate to _tuple_compare, passing the first parameter:
tuple_size<_Tp>::value - tuple_size<_Tp>::value
Which should be:
tuple_size<_Tp>::value - tuple_size<_Up>::value
The template which accepts this is only implemented for this value being 0, so
any other value produces a compile time error.
I broke this (woops) in r91171, back in 2004. The code has continued to be
updated as tuple has changed, and no-one seems to have noticed it made no sense
;)
--
chris at bubblescope dot net changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |chris at bubblescope dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35480