anonymous namespace in c++ cannot access header -
i have enum
in header:
namespace somespace { namespace internal { class someclass { public: typedef enum { knone = 0, kkaka = 1, }someenum; } } }
in cpp, use anonymous namespace helper functions.
#include <somespace/internal/someclass.h> using somespace::internal; namespace { bool helpme(someenum& foo) //does not recognize enum in header { } } void someclass::membermethod { }
but cannot access someenum
in .cpp
file. why that? how can around without polluting internal
namespace example?
someenum
scoped class name declared in. use need someclass::someenum
. assumes someclass
accessible in scope have it. if not need somespace::internal::someclass::someenum
Comments
Post a Comment