Boost logo

Boost Users :

From: Daniel Krügler (dsp_at_[hidden])
Date: 2008-08-20 02:20:53


David Abrahams wrote:
> on Tue Aug 19 2008, Daniel Krügler <dsp-AT-bdal.de> wrote:
>
>
>>>An operator== that applied for only one of many overloads would be an
>>>abomination, especially if the class were empty.
>>
>>Right, if the class is empty, all operator() overloads
>>are stateless,
>
> What about random number generators (or anything else that uses global
> state?)

Note that I'm restricting on EqualityComparable for predicates
(therefore I carefully choose the name comparable_predicate).

Can you think of any reasonable *predicate* with global state?

>>but this is not necessarily the case, if at least one of them is
>>statefull (and therefore the complete class type is not empty). There
>>are still good chances, that some (or even all) of them are still
>>stateless (because they are not influenced by that state).
>>
>>Or to express the problem in different words: In general
>>there exists a one-to-many relation between a class
>>type and it's operator() overloads [acting as predicates],
>>so the class-type alone is not sufficient to define
>>an equality of *one* special operator() overload, which
>>we are interested in. Therefore the predicate equality needs
>>to be restricted to a given predicate (a given operator()
>>overload).
>
>
> I think you're over-engineering this. It's not unreasonable to require
> operator== to make sense in this context.

This answer is a bit too short for me and has not
the convincing power which we usually get from your
contributions ;-)

But I let it settle for a while - as I already said:
I might have a bit too strict point of view on this
and I would really appreciate further comments. If
this would no longer match the boost-relevant context
please send your mail to me - either of
<dsp-AT-bdal.de>
or
<dan~remove_this~iel.kruegler-AT-go~remove_this~oglemail.com>
is fine.

- Daniel


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net