2
我有一个类,我想从boost :: mpl :: vector中的每个类的容器继承一个类。换句话说,这样的事情:为boost mpl列表中的每种类型继承容器
template <typename types_vector>
class A : inherit from std::vector<type> for each type in types_vector {
};
举例来说,如果我有这样的载体:
typedef boost::mpl::vector<bool, int, double> types_vector_;
然后A<types_vector_>
将扩展为:
class A : public std::vector<bool>, public std::vector<int>, public std::vector<double> {
};
我怎么能做到这一点不使用C++ 11功能(其余代码尚未准备好)?我认为使用boost MPL是一条可行的路线,但如果除了C++ 11以外还有其他选择,我可以考虑。
唔...你可以看一下洛基... http://loki-lib.sourceforge.net/ – ForEveR