Self-document a type-alias (typedef) to indicate that it will be used in another certain class
问题 How to self-document a type-alias that is used in another certain library? In the below example, class User defines an alias User::type that is supposed to be referred only in class Library via T::type . Here is the diagram :- Library.h Library<T> expected only T that defines a certain alias (e.g. T::type in this example). #include <iostream> class Base{}; //dummy for the sake of example template<class T>class Library{ Base* t=nullptr; public: typename T::type getValue(){return static_cast