Boost logo

Boost :

From: Darren Cook (darren_at_[hidden])
Date: 2005-07-27 18:24:02


>>>In the Quantum::Superpositions module manual page are examples to get
>>>the min/max of a list in one line of code, which is based on the
>>>resulting junction of a comparison:
>>>
>>>Minimum of a : any_of( a ) <= all_of( a )
>>>Maximum of a : any_of( a ) >= all_of( a )
>...
> For example "a" contains 1, 2, 3 then the resulting junction of any_of(
> a ) >= all_of( a ) contains 3, which is the maximum value of a.

I don't think you need to worry about supporting this; it is bad code as
it will need a comment to say what it is doing, and C++ already has an
idiom for finding min/max in a list: min_element() and max_element().

Darren


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk