If I have a class Foo in a namespace string:
namespace bar { class Foo { ... } };
Then I can:
using Baz = bar::Foo;
and now this is exactly the same as I defined a class in my namespace called Baz.
Is it possible to do the same for functions?
namespace bar { void f(); }
And then:
using g = bar::f; // error: 'f' in namespace 'bar' does not name a type
What is the cleanest way to do this?
The solution must also be implemented for the template functions.
Definition: If any object B is an alias for A, then if any or all of the customs (not declarations or course definitions) of A are replaced by B in the source code, different from the code with a separator, remains unchanged. For example, typedef AB is an alias. #define BA is an alias (at least). T& B = A not an alias, B can be effectively implemented as an indirect pointer, if "unaliased" A can use "immediate semantics".
c ++ gcc linux c ++ 11
Andrew Tomazos Mar 25 2018-12-21T00: 00Z
source share