Boost logo

Boost :

From: Steven Watanabe (steven_at_[hidden])
Date: 2007-03-03 21:40:43


Manuel Fiorelli <manuel.fiorelli <at>> writes:

> I know that standard C++ prohibits template parameters and typedefs in
> friend declarations, thus the only way to eliminate the problem seems to use
> an ad-hoc non_derivable helper for each class, but this should require a
> less clean approach:

Even though it is prohibited most compilers allow
it. You might want to look at

> - Can someone say me what is the reason to use a nested
> namespace....what does it mean "unintended ADL"

namespace boost {
    template<class T0>
    void f(const T0&);

namespace my_namespace {

    class A {};

    class B : BOOST_NON_DERIVABLE, public A {};

    void f(const A&);

    void f() {
        B b;
        f(b); //calls boost::f


In Christ,
Steven Watanabe

Boost list run by bdawes at, gregod at, cpdaniel at, john at