【发布时间】:2014-05-12 14:04:10
【问题描述】:
我希望能够创建一个值是另一个 std::map 的 std::map,并且我希望能够将此映射嵌套到任意深度。
这是一个基本的例子:
std::map < std::string, std::map < std::string, int> > d1;
// so the next depth would be.
std::map < std::string, std::map < std::string, std::map < std::string, int> > > d2;
我知道这对于固定长度很简单,但我不确定如何构建可变深度。
【问题讨论】:
-
你能举例说明如何使用这样的类吗?