Essentially what I want to know is if it's possible to use an anonymous namespace to somehow nest a using directive without it being applied to the global scope.
Essentially I have something that looks like this:
1 2 3 4 5 6 7 8
namespace {
using std::string;
using std::map;
using std::function;
class lTest
{
For example, the using std::string also applies to the global scope, so I can use "string" instead of "std::string" outside the scope of the namespace. I don't really want that, is there any way to avoid that? Or is there any other way for me to accomplish this in a simple way?
I want to write a class that's accessible globally, that doesn't require me to specify MyNameSpace::MyClass, and I want to be able to use std::string, std::function, and whatnot only in my class so my code looks like this: