Boost logo

Boost Users :

From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2005-03-04 00:04:21


"Thorsten Ottosen" <nesotto_at_[hidden]> wrote
> "Arkadiy Vertleyb" <vertleyb_at_[hidden]> wrote in message
...
> | Well, then I hate to say this, but IMHO this is a problem in the
Boost.Range
> | design :-(
>
> It is deliberate design. All generic code that uses boost.range should
> use unqualified calls to enable ADL.
...
> |
Range(std::vector<MyNamespace::SomeTemplate<boost::multi-index<boost::mpl::v
> | ector> > > )
> |
> | Now ADL will use std, boost, MyNamespace, boost::multi_index, and
boost::mpl
> | to find Range. There is absolutely no guarantee that it won't find
> | conflicting functions :-(
>
> I don't get this. Surely one of the functions would be a better match than
> the others and hence called.

How is

namespace MyNamespace
{
    template<class T> end(const T&);
}

is better match than

namespace YourNamespace
{
    template<class T> end(const T&);
}
?

And now:

MyNamespace::Foo<YourNamespace::Bar> obj;
end(obj); // ?????

Regards,
Arkadiy


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