
From: Thorsten Ottosen <nesotto@cs.aau.dk>
(2) go for a class like range_traits<T>::begin()...ect.
Given the set of things that must be specialized to make a type conformant, as documented in https://www.cs.aau.dk/~nesotto/C++/doc/boost_range.html#minimal_interface, that seems like a beneficial thing to do. You could then document a SinglePassRange traits class and a ForwardRange traits class. I don't think that the usual arguments against traits blobs apply here. With the traits classes, the concepts can be defined in terms of proper specialization of the traits classes. (Your support for Standard containers can be provided via library-supplied specializations so the containers can be documented as satisfying the Range concepts because of those specializations.) The existing interface--boost::begin(), etc.--can be rewritten to use the traits class interface. The naming of the traits classes, which become the customization points, remains something of an issue however. They could be single_pass_range_traits and forward_range_traits in the boost namespace, but that hardly fits the goal of enabling their adoption as widely accepted, public domain, customization points. Putting them in the global namespace may be too presumptuous. I don't know what the right answer is. -- Rob Stewart stewart@sig.com Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;