|
Boost : |
From: Dave Abrahams (abrahams_at_[hidden])
Date: 1999-11-11 00:07:40
>> P.S. I don't love the idea of defining a non-member op==, etc. with
> an eye
>> towards encouraging users to specialize for the comparison of object
>> contents. It seems rather like a nightmare to have shared_ptr<X> and
>> shared_ptr<Y> differ so significantly.
>
> Do you mean that op== should be a member, or that it's OK for it to be
> a non-member, but people shouldn't be encouraged to specialize it?
I would prefer for it to be a member, so that we could take advantage of my
operators.h library ;)
My instinct is that it should be a member. I know it might seem draconian,
but I don't like the idea of even allowing a specialization. I would prefer
that users be forced to define a functor for use where a different
comparison is desired. Some people prefer as much flexibility as possible. I
prefer lots of flexibility, but no more than neccessary. The flexibility to
specialize op== in this way, it seems, can only cause confusing code with no
significant benefit.
-Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk