Boost logo

Boost :

Subject: Re: [boost] Inconsistency between std::minmax and boost::minmax
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2012-02-24 17:00:54


On Fri, Feb 24, 2012 at 1:52 PM, Marshall Clow <mclow.lists_at_[hidden]>wrote:

> So, C++11 has been approved, and in the new standard library, there is:
>
> template <typename T>
> std::pair<const T&, const T&>
> minmax ( const T& a, const T& b )
>
> but in Boost, we've got:
> template <typename T>
> tuple< T const&, T const& >
> minmax(T const& a, T const& b) {
>
> I can easily change boost minmax to return a pair instead of a 2-element
> tuple, but that's an interface change, and might break existing code.
>
> On the other hand, giving them the same interface will make it easier for
> people to move to C++11's library functions.
>
> Any opinions? ideas?
>

I could be wrong about this, but wouldn't that be problematic for C++03
std::pair, which (typically) barfs when instantiated with reference types?

- Jeff


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