
On Thu, Nov 8, 2012 at 12:35 AM, Gennadiy Rozental <rogeeff@gmail.com>wrote:
Hi,
iterator_range operators are defined like this:
template< class IteratorT, class ForwardRange > inline bool operator==( const ForwardRange& l, const iterator_range<IteratorT>& r ) { return boost::equal( l, r ); }
These needs to be restricted with enable_if on type of first argument. I have a scenario where I want to define operator== for my own type and want to be able to use it with iterator_range as second argument. Above definition makes it impossible.
Is your type a range? How does its semantics differ from the operator== above? Presumably if you want to specifically address boost::iterator_range, then template< class I > inline bool operator==(my_type, iterator_range<I>); should be a preferable overload. - Jeff