Boost logo

Boost Users :

From: Simon Buchan (simon_at_[hidden])
Date: 2005-09-29 17:01:01


Anakreon wrote:
>>It may be more useful to generalise this further, depending on how often
>>it's used. (Also, it's considered better taste to not add members that
>>don't need to be members) Optionally:
>>
>>// Would be safer with a overloadable transaction id type
>>bool operator==(Event const& e, int id)
>>{ // as above, but e. , not e->
>>}
>>
>>and then use: find_if(..., *_1 == tId);
>
> It doesn't look like good practice to declare the equality operator
> compare an Event object with an int.

Indeed. Hence the comment about having a specific transaction type.
Only do this if it makes logical sense, of course.


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