
on Thu Oct 06 2011, Marshall Clow <mclow.lists-AT-gmail.com> wrote:
template< typename Iter > requires InputIterator<Iter>, EqualityComparable<iterator_traits<Iter>::value_type> bool none_of_equal ( Iter first, Iter last, iterator_traits<Iter>::value_type const& value ) ; // option 2
I think you're missing the requirement is that the value passed in be convertible to "iterator_traits<Iter>::value_type", since that is what will happen at the call site.
No! <sorry, I'm getting excited> If I write a function that takes an int, do I have to specify that you can pass "anything convertible to an int?" No! The same applies f when you write a function that takes a reference to the iterator's value_type. The function signature clearly says what is happening. The fact that a conversion can happen is not the algorithm author's problem when written this way. -- Dave Abrahams BoostPro Computing http://www.boostpro.com