help with Koenig Lookup

R

REH

I'm a little confused about argument dependent lookup. Exactly when does
this apply? Specifically, I was hoping to use it to access enumeration
constants. For example:

namespace Flags {
enum flag_type {F1, F2, F3};
}

void foo(Flags::flag_type f)
{
}


int main()
{
foo(F1);
}

A my compiler's fail to find "F1" (and they are probably correct). I
thought that Koenig lookup searched for names in the namespaces of the
arguments' types. Now that I think about it, does it look in the namespaces
for the formal or actual arguments?

Thanks.
 
A

Andrey Tarasevich

REH said:
I'm a little confused about argument dependent lookup. Exactly when does
this apply?

C language has nothing named "Koenig lookup" or "argument dependent
lookup". You have to ask your question in a newsgroup dedicated to C++
language.
 
R

REH

Andrey Tarasevich said:
C language has nothing named "Koenig lookup" or "argument dependent
lookup". You have to ask your question in a newsgroup dedicated to C++
language.

Yes, Sorry. I had sent it before I realized my mistake. I tried to cancel
the message, but I guess it didn't "take."
 
L

Lawrence Kirby

On Wed, 19 Jan 2005 09:43:43 -0500, REH wrote:

....
Yes, Sorry. I had sent it before I realized my mistake. I tried to cancel
the message, but I guess it didn't "take."

Cancellations are generally not honoured these days because they can too
easily be used to attack a newsgroup. If you make a mistake posting just
post a followup apologising and directing people to ignore it.

Lawrence
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,800
Messages
2,569,657
Members
45,417
Latest member
BonitaNile
Top