drrngrvy wrote:
Consider:
<>
namespace a {
namespace nested { class a_class {}; }
}
namespace b { using ::a::nested::a_class; }
namespace c { typedef ::a::nested::a_class a_class; }
</>
Is there any difference between b::a_class and c::a_class? I have a
feeling that b::a_class uses ADL, whereas c::a_class doesn't, but I'm
neither sure why [I think it] nor trust I have the right impression.
Are there any situations where there's a difference between the two?
You need to find the places where a typedef-name is unacceptable.
I can recall only a couple at this time: elaborate type specifiers,
definition of a constructor or destructor (a type name is needed).
Since it is unlikely you're going to define the c-tor or d-tor in
the other namespace, the only real "danger" is to use the name
'a_class' to declare it a friend of something in 'b' or 'c', which
requires an elaborate type specifier, where a typedef-name is not
allowed.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask