我正在尝试使用 gcc 进行编译
\n\n#include <string>\n#include <vector>\n\nstd::vector < std::string, std::vector < std::vector < int > > > plain;\n\nint main(){\nreturn 0;\n}\nRun Code Online (Sandbox Code Playgroud)\n\n但出现错误:\n 错误: \xe2\x80\x98class std::vector"<"std::__cxx11::basic_string, std::allocator"<"std::vector"<"int>> > >\xe2 \x80\x99 没有名为 \xe2\x80\x98deallocate\xe2\x80\x99 的成员
\n你的plain就是在std::vector<std::string, NotReallyAnAllocator>哪里。NotReallyAnAllocatorstd::vector < std::vector < int > >
A std::vector(任何东西)都不是分配器,编译器明确抱怨它没有实现必要的分配器接口。
我不确定您想要实现什么,但请研究一下std::unordered_map您std::map是否需要键值容器。
| 归档时间: |
|
| 查看次数: |
2362 次 |
| 最近记录: |