Given this header
// header.h
#include <string>
namespace company
{
namespace module
{
class ProjectConstants
{
public:
static const int CONSTANT1;
static const std::string CONSTANT2;
};
}
}
and this source file
// header.cpp
#include "header.h"
using company::module::ProjectConstants;
const int ProjectConstants::CONSTANT1 = 10;
const std::string ProjectConstants::CONSTANT2("Hello World");
Are ProjectConstants::CONSTANT1 and ProjectConstants::CONSTANT2 declared in the global namespace or not?
I am asking this because our project follows a coding standard that requires that the global namespace is not polluted and I thought that this wouldn't do that, however when using static analysis, FlexeLint, it says that the code at lines 7 and 8 of the cpp file place the symbols in the global namespace.