Your std::make_pair
is wrong. To get closer you need a std::set<int>
instead of the std::set
.
But what you really want is to just let to compiler make it for you:
firstSets.insert(std::make_pair(decl, declFirstSet));
or use an easier syntax:
firstSets[decl] = declFirstSet;
EDIT AFTER UNDERSTANDING THE PROBLEMOn the otherhand, you want firstSets
to come with initial content you can reorder the declarations:
#include <set>#include <string>#include <unordered_map>std::string decl{"decl"};std::set<int> declFirstSet{1, 2, 3, 4};std::unordered_map<std::string, std::set<int>> firstSets{{decl, declFirstSet}};int main() {}