What are the differences between using
typedef Some::Nested::Namespace::TypeName TypeName;
or
using Some::Nested::Namespace
Using just brings declaration into the local scope, while typedef introduces a typedef-name. One difference between them is elaborated type specifiers, e.g.:
namespace n
{
class foo
{
};
}
typedef n::foo n_foo;
using n::foo;
int main()
{
class foo f1; // ok, declares f1 variable of type n::foo.
class n_foo f2; // error, typedef-name can't be used in elaborated-type-specifier.
}