|
Boost : |
Subject: Re: [boost] Interest check: memoization
From: James Porter (porterj_at_[hidden])
Date: 2009-01-25 02:04:52
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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk