Difference between type alias and declaration of use

Is there a difference between using a type alias and an alias template, on the one hand, and using a declaration, on the other, as follows:

Given the class definition in the namespace scope:

namespace ns1
{
template< typename T >
struct A {};
}

And given a different namespace that introduces a character in Atwo different ways. The first one is a type alias (alias template):

namespace ns2
{
template< typename T >
using A = ns1::A< T >; // match type-id
}

Secondly, used-declaration:

namespace ns2
{
using ns1::A;
}

Is there any difference for ADL and for any other use of contexts in an area ns1(reopened), in an area, ns2or in an external area?

+4
source share

Source: https://habr.com/ru/post/1614994/


All Articles