In a recent discussion, the matter came up as to whether or not we should always fully qualify the current class' name in the class definition, and also use explicitly specialized templates when referring to the current template itself. To sum it up:
namespace foo {
struct Foo {
doSomething(foo::Foo& other); // arguably good
doSomething(Foo& other); // arguably bad
};
}
template<typename T>
struct Bar {
doSomething(Bar<T>& other); // arguably good
doSomething(Bar& other); // arguably bad
};
Problem is, no one could back up their claims with hard facts, it was merely "the name lookup could go wrong" versus "meh, never had any problem".
In order to settle this: are those two conventions strictly equivalent or can the "bad" one sometimes introduce ambiguities in name lookup? References to the current Standard would be very nice.
Of course, the argument of legibility should not be taken into account, I'm really asking about how a standard-conforming compiler will behave in corner cases. However, known implementation bugs are also welcome.
https://ideone.com/f48mJI
In conclusion,
Foo
.