c++ - Does a nested class definition of a template class belong in an ipp file? -
suppose have templated class that, whatever reason beyond scope of question, has nested class declaration:
// outer.hpp template <typename t> class outer { class x; void foo(); // defined in ipp file }; // should go ipp file? template <typename t> class outer<t>::x { }; i'm bit confused should putting definition of x. belong in ipp file along member function definitions, or make sense in header file?
just clear, doesn't matter far compilation goes.
in general, declarations should in header because maintain pattern usage of class can found in header.
for example, if use doxygen, want generate documentation inner class ( without having change settings ).
Comments
Post a Comment