Page 1 of 1

Rule 7-3-6 Clarification

Posted: Thu Feb 27, 2014 2:31 pm
by melinda.bradury
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
bool_t IsActive(void);

or would i have to do this...
BasicTypes::bool_t IsActive(void);

Re: Rule 7-3-6 Clarification

Posted: Mon Oct 05, 2015 2:59 pm
by misra cpp
This use is not safe as a user of "ComponentX" can also access symbols from "BasicType".

Rule 7-3-6 correctly prohibits such use.