#include <iostream>
#include <string>
#include <map>
#include <set>
#include <initializer_list>
typedef std::map<std::string, bool> M1;
typedef std::set<int, const M1&> S1;
const static M1 m_1 = {{"USA", 0}, {"Africa", 1}, {"Netherlands", 0}};
const static M1 m_2 = {{"apple", 1}, {"oranges", 0}, {"pineapple", 0}};
const static M1 m_3 = {{"desk", 0}, {"chair", 1}, {"lamp", 0}};
const static S1 s_1 = {{33, &m_1}, {42, &m_2}, {77, &m_3}};
int main() { return (0); }
当我尝试编译这段代码时,我只收到 1 个初始化错误set
,而且我不知道为什么我的编译器会这样(clang 3.4 和 gcc 4.8.1),因为它是一个简单set
的这就是我提供给构造函数的内容。int
constant references
map
我在这里缺少什么?