
27 Jul
2005
27 Jul
'05
11:24 p.m.
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