|
Boost : |
From: David Abrahams (abrahams_at_[hidden])
Date: 2000-06-23 07:22:28
----- Original Message -----
From: "Mark Rodgers" <mark.rodgers_at_[hidden]>
> It is actually valid to define a friend within a class, but on looking it
> up, I see that it is only valid if the function has namespace scope
> (11.4p5).
>
> So to define
>
> rational<int_type> ::abs(const rational<int_type> &r)
>
> in such a way would have been valid, but to define
>
> rational<int_type> boost::abs(const rational<int_type> &r)
>
> as I was trying to do would seem to be invalid. :-(
Nope. "Namespace scope" doesn't mean "global namespace scope". Functions
declared in boost:: have namespace scope.
-Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk