Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个:
template<class T, class E> class Bla { }
我想让其他类可以访问 T ,例如:
Bla::TypeOfE
在 C++03 中这样的事情是可能的吗?怎么做?
在public部分添加
public
typedef T TypeOfT;
像这样使用它
Bla<int, double>::TypeOfT value;
是的:
template<class T, class E> class Bla { public: typedef E TypeOfE; }