Take a look at this simple snippet:
namespace Test
{
struct A {};
void foo( A _a ) {}
}
int main( int, char** )
{
foo( Test::A() ); // 1. why foo doesn't require Test:: ?
Test::foo( A() ); // 2. why A() requires Test:: considering above line?
return 0;
}
As mentioned in the source:
foo( Test::A() );
whyfoo
doesn't requireTest::
here?Test::foo( A() );
whyA()
requiresTest::
considering above line?
(Visual Studio 2008 and gcc4.8 give the same result, so I suppose this is standard behavior, but I'm wondering which part of standard defines it?)