This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Namespace Lookup
- To: egcs at cygnus dot com
- Subject: Namespace Lookup
- From: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Tue, 10 Mar 1998 08:16:12 +0100
Is the following correct C++? If so, why? I.e. why is the operator<<
visible?
TIA,
Martin
class ostream;
extern ostream cout;
namespace foo
{
struct S
{
int i;
};
extern ostream &operator<<(ostream &, const S &);
}
void bar(foo::S s)
{
cout << s ;
}