
25 Jan
2009
25 Jan
'09
7:04 a.m.
Steven Watanabe wrote:
The implementation of less in upgradable_tuple_inner doesn't look quite right.
return get(as_ref) < rhs.get(rhs_as_ref) || tail.less(as_ref,rhs.tail,rhs_as_ref);
Shouldn't this be
return get(as_ref) < rhs.get(rhs_as_ref) || (!(rhs.get(rhs_as_ref) < get(as_ref)) && tail.less(as_ref,rhs.tail,rhs_as_ref));
This is true. I was operating under the assumption of totally ordered sets. Thankfully, it's simple issue to fix!
Also, upgradable_tuple_inner::upgrade isn't exception safe.
Also true. I'll have to consider the best route to take with this. The upgrade() function isn't exactly pretty to begin with (though it would look much nicer with unrestricted unions :) ). - Jim