AMDG Mathias Gaunard wrote:
namespace boost { namespace range_detail { template<typename T> ... begin(const T& t) { return t.begin(); } }
template<typename T> ... begin(const T& t) { using range_detail::begin; return begin(t); }
}
(Needs to replace ... with range_iterator<T> variants, add non-const overloads, handle the old range_begin customization point) I don't see how that kind of thing can cause infinite recursion. If there is no overload of begin picked up by ADL, it uses range_detail::begin.
I see. I forgot about the default implementation. The problem with this scheme is that if boost is an associated namespace of T, then boost::begin will be ambiguous with boost::range_detail::begin. The workaround used by boost::swap doesn't work in this case. In Christ, Steven Watanabe