does using directive has local scope??
i find in C++ primer book that " a using directive in a function treats the namespace names as being declared outside the function"
if it is like declared outside a function why doesn’t it make those names available to other functions in the file.
namespace Jill
{
double bucket(double n) { ... }
double fetch;
struct Hill { ... };
}
int main()
{
using namespace Jill;
return 0;
}
int foom()
{
Hill top; //error
Jill::Hill crest; //valid
}
if the statement "a using directive in a function treats the namespace names as being declared outside the function" is true than
`Hill top`
would have been valid?