summaryrefslogtreecommitdiff
path: root/graphs/cpp/bimap/bimap_example.cc
blob: 771a2b0ce3a8ca6c8d14e34c00d2d98d0fb869cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
#include <string>

#include "bimap.hh"

int main()
{
    Bimap<int, std::string> bm;

    bm.insert(16, "Test.");
    bm.insert("Prologin", 29);

    std::cout << "The bimap contains: " << bm.size() << " elements\n";

    auto it1 = bm.find("Test.");
    auto it2 = bm.find(29);

    std::cout << it1->first << ' ' << it1->second << '\n';
    std::cout << it2->first << ' ' << it2->second << '\n';

    bm.erase(16);
    bm.erase("Prologin");

    bm.clear();
    return 0;
}