
7 Oct
2012
7 Oct
'12
12:06 a.m.
On Sat, Oct 6, 2012 at 2:29 PM, Andrew Sutton <asutton.list@gmail.com>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