Boost logo

Boost Users :

From: Maximilian Matthe (Maxi.Matthe_at_[hidden])
Date: 2008-07-24 15:04:14


david.weber_at_[hidden] schrieb:
> The best way I've seen, is to make a testing class a friend of class to
> be tested. My class to be tested is in a namespace, that the test cases
> are not members of. I'm running into all sorts of compiler errors.
>
> Does anyone have sample code about making this work.

Well, if you just want to add a friend which isn't in your namespace,
why dont do this:

namespace foo
{
class A
{
        friend ::other_namespace::the_friend;
};
}

?

Using :: in front of a type gets out of the current namespace.

I hope I could help,
Max


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