
Hi all, Could we agree on a naming scheme/implementation scheme for the customization-points? I prefer range_begin() range_end() range_size() to boost_range_begin() boost_range_end() boost_range_size() and think these identifiers are unique enough, the small amout of global costomization-points taken into consideration. The consequence of this is that other libraries should always call boost::begin() with qualification. This function must always fall back on a function template which implements the default behavior. The consequence for users is that they must - provide hooks in their own namespace wich is then found via ADL. - Users can specialize boost::begin, but not boost::unspecified_namespace::range_begin. - Global functions will not be found. - derived to base-class conversion are not performed before ADL tries to locate a function -Thorsten

Thorsten Ottosen wrote:
Could we agree on a naming scheme/implementation scheme for the customization-points?
I prefer
range_begin() range_end() range_size()
to
boost_range_begin() boost_range_end() boost_range_size()
and think these identifiers are unique enough, the small amout of global costomization-points taken into consideration.
I'd like to comment on a more general point than just the names: If we offer customizations points for a specific library, why should we use ADL at all? Compared to a customization point bound to the library's namespace (e.g. boost::customize::range::begin, etc.), ADL leads to less typing to write down the specializations (which is nice) and reserved names in other namespaces (which is bad). And AFAICS, there is no difference for the users of the customized UDTs. The intrusiveness of reserving names in other namespaces is what worries me, so I'd tend to avoid ADL for the range library's customization points. It might also lead to a cleaner design on the user's side as the user will more likely separate his UDT from the binding to the range library (although that's just a wild guess). To me it seems that ADL only makes sense if we can hope for UDTs to provide certain functions (with the right semantics) without the UDT's author knowing about us. Take swap() as an example. It's a reasonable (although potentially wrong) assumption that using std::swap; swap( x, y ); might find a more efficient implementation for swap than calling std::swap directly. But we can not (and should not) assume that the author of swap() has any idea who uses his function. Don't forget ADL's roots: Operators. Operators have (or really: should have ;) a clear semantics. And swap() is close to being an operator semantically, that's why ADL is a good idea for swap, too. Man, I even wish swap would be a real operator, as well as a I'd wish for a move operator. This is where ADL makes sense and should be applied. All other cases of ADL I've seen so far were more or less dangerous. YMMV. Regards, Daniel

Daniel Frey wrote:
Thorsten Ottosen wrote:
Could we agree on a naming scheme/implementation scheme for the customization-points?
I prefer
range_begin() range_end() range_size()
to
boost_range_begin() boost_range_end() boost_range_size()
and think these identifiers are unique enough, the small amout of global costomization-points taken into consideration.
I'd like to comment on a more general point than just the names:
If we offer customizations points for a specific library, why should we use ADL at all?
You might want to read the recent threads "[serialization] Doc problems", "[range] How to extend Boost.Range?" and the threads mentioned there. Jonathan

Thorsten Ottosen wrote:
Hi all,
Could we agree on a naming scheme/implementation scheme for the customization-points?
I prefer
range_begin() range_end() range_size()
to
boost_range_begin() boost_range_end() boost_range_size()
Me too. Using boost_range_xxx seems like some sort of misplaced politeness. Do we really think that someone else will use the names range_begin, etc.? If so, we should claim them first. If not, what's the problem with our using them? Also, it might be a good idea for someone to write Boost guidelines for customization points, explaining the use of ADL, specialization of class templates, broken-compiler workarounds, and the methods that don't work. I'm might volunteer if no one else is eager, but it won't get done for a while. Jonathan

Jonathan Turkanis <technews <at> kangaroologic.com> writes:
Also, it might be a good idea for someone to write Boost guidelines for customization points, explaining the use of ADL, specialization of class templates, broken-compiler workarounds, and the methods that don't work.
I'm might volunteer if no one else is eager, but it won't get done for a while.
I'll gladly help you out. br Thorsten

Thorsten Ottosen wrote:
Jonathan Turkanis <technews <at> kangaroologic.com> writes:
Also, it might be a good idea for someone to write Boost guidelines for customization points, explaining the use of ADL, specialization of class templates, broken-compiler workarounds, and the methods that don't work.
I'm might volunteer if no one else is eager, but it won't get done for a while.
I'll gladly help you out.
Thanks.
br
Thorsten
Jonathan
participants (3)
-
Daniel Frey
-
Jonathan Turkanis
-
Thorsten Ottosen