Boost logo

Boost :

Date: 2002-07-25 02:23:42

At Thursday 2002/07/25 00:02, you wrote:
>Hi Boosters,
>Victor A. Wagner, Jr. wrote:
>>I've noticed in our coding, we sometimes need a comparison operator that
>>works on just a single element in a struct, instead of the "entire
>>struct". If we need to sort the container using just this "key"; we, of
>>course, write the comparison function/functor and then:
>>I decided to write a couple templates and helper functions called (the
>>ones you'd use) less_element() and greater_element().
>It is not very flexible.
>What about function objects that are not yet invented?

it's not "flexible" in that sense at all.... they ONLY does < and >. But
they ARE useable for std::sort() something that I don't see being able to
do w/ yours.
I'm reasonably certain they can be improved, but we've got to use MSVC so
there are limits to how fancy I can get at this point.

>Some time ago I wrote the adaptor class that allows you to wrap
>*arbitrary* functor (less, greater, etc.) in a uniform manner:
>(please scroll down the page to the third example - the others are used by
>me in flame wars with Java extremists ;-) and are not relevant here)
>Maciej Sobczak
>Unsubscribe & other changes:

Victor A. Wagner Jr.
PGP RSA fingerprint = 4D20 EBF6 0101 B069 3817 8DBF C846 E47A
The five most dangerous words in the English language:
               "There oughta be a law"
