Boost logo

Boost :

Subject: Re: [boost] [contract] concept error messages
From: Matt Calabrese (rivorus_at_[hidden])
Date: 2012-10-06 20:06:50


On Sat, Oct 6, 2012 at 2:29 PM, Andrew Sutton <asutton.list_at_[hidden]>wrote:

> Lots of reasons, but mostly it clearly delineates what is required
> from what is returned.
>

I agree with you that requires is important, particularly for concept-based
overloads where one overload has more refined concepts than another, though
in C++11, you no longer need to use enable_if in the return type or
function parameter list, so obfuscation of the function type is not as much
of a concern as it used to be. For instance, if you use the enable_if
library in the sandbox you can simply do:

template< class T, BOOST_ENABLE_IF( contract::std::EqualityComparable< T >
) >
bool equal1( T const& a, T const& b );

-- 
-Matt Calabrese

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