This does not work, because the C ++ language does not have such a function and has never been. A usage declaration for a class member must be a member declaration. This means that you can only use in the scope of the class, but never in the local scope. All this is absolutely not related to templates.
In other words, you can put your usage declaration in the class scope
struct Derived : public Base<T> { ... using Base<T>::x; ... };
but you cannot use it inside a function.
Using-declarations for members of a namespace can be placed in a local scope, but using-declarations for members of a class cannot be. This is why the error message complains that Base<T> not a namespace.
source share