Boost logo

Boost Users :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2005-03-08 06:38:00


"Eric Niebler" <eric_at_[hidden]> wrote in message
news:422CEAE9.3020708_at_boost-consulting.com...
| Thorsten Ottosen wrote:

| > My suggestion have been to allow
| >
| > boost::some_range_fun(r);
| >
| > to support ADL via the requirement that users implement
| >
| > adl_some_range_fun(r);
| >
| > Can you confirm that this would remove the present problems with gcc?
| >
| > If so, I will propose this on the developer list and make it part of 1.33
| >
|
|
| I admit I've only skimmed the ongoing discussion, but something like
| what you are suggesting here should work, I think. How about this:
|
| namespace boost {
|
| namespace range_detail_ {
|
| template<typename T>
| typename range_iterator<T>::type boost_range_begin(T& t) {
| // ...
| }
|
| template<typename T>
| typename range_iterator<T>::type begin(T& t) {
| // this uses ADL
| return boost_range_begin(t)
| }
|
| } // namespace range_detail_
|
| using range_detail_::begin;
|
| }

how this is exactly implemented in boost.range is of minor concern
to me; I'm after the protocol.

|
| Recommended practice would be to always use qualified calls to
| boost::begin,

yes.

| and then let users define overloads of boost_range_begin
| in their own namespace and let ADL find it.

yes, except I was suggesting to call it adl_begin().

| Does that satisfy everybody's concerns? (Probably not, but it couldn't
| hurt to ask, right?)

no, it couldn't hurt.

-Thorsten


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net