You can achieve this with a using
declaration.
namespace foo
{
void print()
{
//do work...
}
}
namespace bar
{
using foo::print;
}
EDIT
Regarding the difference between ::foo::print
and foo::print
: prepending a qualified name with :: means that you explicitly refer to the one in the global namespace. This can be used to select the global one, even if there is another item with the same name closer in scope.