I have this in a .cpp file:
namespace {
std::string CListName;
}
namespace EXAMPLE_NS {
CListName = "ListName";
...
But Eclipse highlights the assignment as a Syntax Error. I take it you can’t use an anonymous namespace from another namespace?
CListName = "ListName";is a statement (specifically, it’s an assignment expression, which is an expression statement).A statement cannot appear at namespace scope; you need to put the statement into a function.