MISRA Discussion Forums

Full Version: Rule 7-3-6 Clarification
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Does this rule prevent "using namespace ..." in a header file, if, it is inside a namespace?

e.g. is it ok to do this in the header...
namespace ComponentX
{
using namespace BasicTypes;
class AClass
{
public:
bool_t IsActive(void);
};
}
}

or would i have to do this...
BasicTypes::bool_t IsActive(void);
This use is not safe as a user of "ComponentX" can also access symbols from "BasicType".

Rule 7-3-6 correctly prohibits such use.