问题描述
我收到以下代码(error.cpp)的错误:
#include <map>
#include <functional>
#include <vector>
int main()
{
std::map<
int,std::map< std::string,std::map<std::string,std::string>
> > >
> > >
> > >
> > >
> > >
> > >
> > oups;
}
使用调试标志进行编译时:
g++ error.cpp -g -o error
我的系统是Ubuntu 18.04,其中g ++ 7.5.0作为VM运行。 RAM为5GB,交换为2.5GB。剩下的硬盘空间为1GB。
这正常吗?有毛病吗有限制吗?
以上代码将是“更精细”的替代方案吗? (c ++ 14)
解决方法
在该定义中您有8 + 7 + 6个字符串,对吗?因此,我想说的是,您手中拥有的是关系21。为什么不尝试:
constexpr const std::size_t my_arity = 21;
std::unordered_set<std::array<std::string,my_arity>> oups;
相反?