Ejemplo n.º 1
0
std::unordered_multiset<int> const build_unordered_multiset()
{
    typedef std::unordered_set<int> int_set;
    typedef std::unordered_multiset<int> int_multiset;
    int_set const data = build_unordered_set();
    return int_multiset(data.begin(), data.end());
}
Ejemplo n.º 2
0
static bool operator==(int_set const & v1, int_splay_tree const & v2) {
    buffer<int> b;
    // std::cout << v2 << "\n";
    // std::for_each(v1.begin(), v1.end(), [](int v) { std::cout << v << " "; }); std::cout << "\n";
    v2.to_buffer(b);
    if (v1.size() != b.size())
        return false;
    for (unsigned i = 0; i < b.size(); i++) {
        if (v1.find(b[i]) == v1.end())
            return false;
    }
    return true;
}