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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -