
On Sat, Oct 1, 2011 at 11:20 AM, Neil Groves <neil@grovescomputing.com> wrote:
Yes, I maintain Boost.Range hence my comments with respect to ranges are reasonably well informed. I have long been a fan of Design by Contract and hence I have experience using my own versions of the functions all_of etc.
Indeed N1962 uses a "contract helper" function all_equals (which should ideally be accompanied by the assertion requirement has_equal_to<T>::value so to not always require the vector's type T to be EqualityComparable): http://svn.boost.org/svn/boost/sandbox/contract/libs/contract/doc/html2/cont... boost::algorithm::all_of_equal (or all_equal_to, or whatever the final named ends being) could be conveniently used here instead of all_equals. The same applies to the contract of most (all?) other STL containers. --Lorenzo