Boost logo

Boost :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2002-10-27 03:44:24

Rani Sharoni wrote:
> > Seems well-formed to me, and works with Intel C++ 6.0 and one other
> > compiler.
> VC7.1/7/6 also compiled the code but Comead (EDG
> based) rejected the code. I suspect that Comeau's EDG, unlike
> the Intel's EDG, is correct because you are actually injecting
> names into the namespace and C++ doesn't allow that.

It might turn out that Comeau is correct after all (I am going to clarify
that on comp.std.c++), but for sure it won't be for the reason you cited
above :). Friend functions declared inside class definitions are found
through the Koenig lookup:

    template< typename T > struct her
        friend void foo(her<T> const&);

    int main()
        her<int> h;
        foo(h); // prefectly OK

See [namespace.memdef] para 3 for the details.


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