Topic: Lookup and qualified friend declarations
Author: Richard Corden <richards_corden@hotmail.com>
Date: Tue, 12 Mar 2002 15:47:27 GMT Raw View
Hi,
I'd appreciate if anyone can clear this issue up for me...
3.4.1/10 describes how for friend declarations naming member
functions, a name used in the function declarator is first looked up
in the scope of the member function's class.
3.4.3/3 describes how when the declarator-id is a qualified-id names
following the qualified-id are looked up in the scope of the member's
class or namespace.
I think therefore, that the following is illformed:
namespace NS
{
void foo (int);
}
class R
{
typedef int I
friend void NS::foo (I);
};
As NS is not a class, then 3.4.1/10 does not apply, and 3.4.3/3 is
used to lookup I, and as there is no I in NS the code is illformed.
So my question is, why do we only consider member functions when
applying 3.4.1/10?
Thanks for any help,
Richard
--
Richard Corden
To reply remove 's' from address
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]