[#regular] = Regular Containers :idprefix: regular_ Boost.Unordered closed-addressing containers (`boost::unordered_set`, `boost::unordered_map`, `boost::unordered_multiset` and `boost::unordered_multimap`) are fully conformant with the C++ specification for unordered associative containers, so for those who know how to use `std::unordered_set`, `std::unordered_map`, etc., their homonyms in Boost.Unordered are drop-in replacements. The interface of open-addressing containers (`boost::unordered_node_set`, `boost::unordered_node_map`, `boost::unordered_flat_set` and `boost::unordered_flat_map`) is very similar, but they present some minor differences listed in the dedicated xref:compliance.adoc#compliance_open_addressing_containers[standard compliance section]. For readers without previous experience with hash containers but familiar with normal associative containers (`std::set`, `std::map`, `std::multiset` and `std::multimap`), Boost.Unordered containers are used in a similar manner: [source,cpp] ---- typedef boost::unordered_map map; map x; x["one"] = 1; x["two"] = 2; x["three"] = 3; assert(x.at("one") == 1); assert(x.find("missing") == x.end()); ---- But since the elements aren't ordered, the output of: [source,c++] ---- for(const map::value_type& i: x) { std::cout<`, `>=` operators. |Can be compared using the `==` and `!=` operators. | |When inserting with a hint, implementations are permitted to ignore the hint. |=== --- [caption=, title='Table {counter:table-counter} Complexity Guarantees'] [cols="1,1,1", frame=all, grid=rows] |=== |Operation |Associative Containers |Unordered Associative Containers |Construction of empty container |constant |O(_n_) where _n_ is the minimum number of buckets. |Construction of container from a range of _N_ elements |O(_N log N_), O(_N_) if the range is sorted with `value_comp()` |Average case O(_N_), worst case O(_N^2^_) |Insert a single element |logarithmic |Average case constant, worst case linear |Insert a single element with a hint |Amortized constant if `t` elements inserted right after hint, logarithmic otherwise |Average case constant, worst case linear (ie. the same as a normal insert). |Inserting a range of _N_ elements |_N_ log(`size()` + _N_) |Average case O(_N_), worst case O(_N_ * `size()`) |Erase by key, `k` |O(log(`size()`) + `count(k)`) |Average case: O(`count(k)`), Worst case: O(`size()`) |Erase a single element by iterator |Amortized constant |Average case: O(1), Worst case: O(`size()`) |Erase a range of _N_ elements |O(log(`size()`) + _N_) |Average case: O(_N_), Worst case: O(`size()`) |Clearing the container |O(`size()`) |O(`size()`) |Find |logarithmic |Average case: O(1), Worst case: O(`size()`) |Count |O(log(`size()`) + `count(k)`) |Average case: O(1), Worst case: O(`size()`) |`equal_range(k)` |logarithmic |Average case: O(`count(k)`), Worst case: O(`size()`) |`lower_bound`,`upper_bound` |logarithmic |n/a |===