|
Boost : |
From: Daryle Walker (darylew_at_[hidden])
Date: 2006-07-18 18:25:55
On 7/11/06 1:47 AM, "Emil Dotchevski" <emildotchevski_at_[hidden]> wrote:
> Daryle Walker wrote:
>
>> [snipped]
>> If you are modeling data that has a standardized order, then it's OK
>> to define (all) the ordering operators. If the order is something
>> that you made up, and doesn't naturally flow with the model, then
>> leave it out as a separate function (object). Don't shove in an
>> ordering scheme via operators, especially if there more than one way
>> to do it[1].
>
> The unspecified strict weak ordering defined by the operator< overload is
> independent from shared_ptr's template parameter. You say that there are
> more than one way to do it. Can you come up with another way? Keep in mind,
> your ordering must be well defined even for shared_ptr<void> objects.
The possibility of multiple definitions was posed as a weakness of the fake
operator "<" technique in general, not of shared pointers in particular.
(If all the potential definitions are unnatural, then why are you blessing
one?) It shouldn't be construed as a challenge to find at least two
definitions. The existence of exactly one unnatural, yet consistent,
ordering doesn't validate the technique.
-- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT hotmail DOT com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk