insert_init.pass.cpp [plain text]
#include <unordered_map>
#include <string>
#include <cassert>
#include "../../../iterators.h"
int main()
{
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
{
typedef std::unordered_map<int, std::string> C;
typedef std::pair<int, std::string> P;
C c;
c.insert(
{
P(1, "one"),
P(2, "two"),
P(3, "three"),
P(4, "four"),
P(1, "four"),
P(2, "four"),
}
);
assert(c.size() == 4);
assert(c.at(1) == "one");
assert(c.at(2) == "two");
assert(c.at(3) == "three");
assert(c.at(4) == "four");
}
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
}