static object c++ "does not name a type" -
i have following code:
// header.h class outer { class mid { mid(); ~mid (); }; class inner { private: static mid m_mid; }; }; when define static private object in cpp file, gives me error saying mid not name type:
// header.cpp: # include "header.h" mid mid::m_mid; {begin definitions outer, mid , inner here} any clue why compiler complain ? : mid not name type
there no class mid; there no member of mid named m_mid.
there is, however, class outer::mid, , class outer::inner has member named m_mid. write instead. :)
outer::mid outer::inner::m_mid;
Comments
Post a Comment