Re: Help with Koenig Lookup
From: REH (bogus_at_nowhere.net)
Date: 01/19/05
- Next message: Greg Comeau: "Re: problem with overloaded pure virtual functions"
- Previous message: chris: "Re: Double comparison problem"
- In reply to: Victor Bazarov: "Re: Help with Koenig Lookup"
- Next in thread: Ioannis Vranos: "Re: Help with Koenig Lookup"
- Reply: Ioannis Vranos: "Re: Help with Koenig Lookup"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 19 Jan 2005 09:42:21 -0500
"Victor Bazarov" <v.Abazarov@comAcast.net> wrote in message
news:EOgHd.36466$NC6.18505@newsread1.mlpsca01.us.to.verio.net...
> Yes. The namespaces of the arguments are searched for the function names.
> So, if you do
>
> namespace Flags {
> enum flag_type {F1, F2, F3};
> void foo(Flags::flag_type f)
> {
> }
> } // namespace
>
> int main()
> {
> foo(Flags::F1); // no qualification for 'foo'
> }
>
> The compiler will resolve 'foo' as 'Flags::foo' because the argument is
> from the Flags namespace.
>
Thank you. That's clear. I like to keep my enums in their own namespace,
but always typing "namespace::constant" gets tedious. I had hoped to use
Koenig Lookup to avoid that, but from what you are telling me I can't (other
than with "using").
Regards.
- Next message: Greg Comeau: "Re: problem with overloaded pure virtual functions"
- Previous message: chris: "Re: Double comparison problem"
- In reply to: Victor Bazarov: "Re: Help with Koenig Lookup"
- Next in thread: Ioannis Vranos: "Re: Help with Koenig Lookup"
- Reply: Ioannis Vranos: "Re: Help with Koenig Lookup"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|