c++ - How to initialize static field in template class with type of inner class -


i have this

template <class t> class outer {     public: class inner;      static inner* x;      //...      class inner {         //...     }; };  // not working template <class t> outer<t>::inner* outer<t>::x = null; 

error says: :16: error: expected constructor, destructor, or type conversion before ‘*’ token

template<class t> class outer { public:       class inner;      static inner* x;      //...      class inner {         //...     }; };  template<class t> typename outer<t>::inner *outer<t>::x = null; 
  1. as typename , class, please refer c++ difference of keywords 'typename' , 'class' in templates

  2. why this, please refer trouble dependent types in templates


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -