Adding minmaxElement to Phobos?

jmh530 john.michael.hall at gmail.com
Thu Sep 5 00:28:32 UTC 2019


On Wednesday, 4 September 2019 at 22:12:28 UTC, Per Nordlöw wrote:
> At
>
> https://stackoverflow.com/a/19954882/683710
>
> I just learned the reason for C++11 having
>
> https://en.cppreference.com/w/cpp/algorithm/minmax_element
>
> Calculating the min and max simultaneously reduces the number 
> of comparisons with 1/4.
>
> Should we add a minmaxElement alongside minElement and 
> maxElement?

The comments suggest that it doesn't have benefit in some cases. 
Can't be that hard to do a simple version and see if it has 
better performance.


More information about the Digitalmars-d mailing list