[#absl-btree_set] = xref:absl.adoc[absl]::btree_set :relfileprefix: ../ :mrdocs: An ordered associative container of unique keys. == Synopsis Declared in `<absl/container/btree_set.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Key, typename Compare = std::less<Key>, typename Alloc = std::allocator<Key>> class btree_set : public /* implementation-defined */::btree_set_container</* implementation-defined */::btree</* implementation-defined */>> ---- == Description An `absl::btree_set<K>` is an ordered associative container of unique key values designed to be a more efficient replacement for `std::set` (in most cases). Keys are sorted using an (optional) comparison function, which defaults to `std::less<K>`. An `absl::btree_set<K>` uses a default allocator of `std::allocator<K>` to allocate (and deallocate) nodes, and construct and destruct values within those nodes. You may instead specify a custom allocator `A` (which in turn requires specifying a custom comparator `C`) as in `absl::btree_set<K, C, A>`. == Base Classes [cols="1,4"] |=== | Name| Description | `/* implementation-defined */::btree_set_container</* implementation-defined */::btree</* implementation-defined */>>` | |=== == Type Aliases [cols="1"] |=== | Name | xref:absl/btree_set/allocator_type.adoc[`allocator_type`] | xref:absl/btree_set/const_iterator.adoc[`const_iterator`] | xref:absl/btree_set/insert_return_type.adoc[`insert_return_type`] | xref:absl/btree_set/iterator.adoc[`iterator`] | xref:absl/btree_set/key_compare.adoc[`key_compare`] | xref:absl/btree_set/key_type.adoc[`key_type`] | xref:absl/btree_set/node_type.adoc[`node_type`] | xref:absl/btree_set/size_type.adoc[`size_type`] | xref:absl/btree_set/value_type.adoc[`value_type`] |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:absl/btree_set/2constructor.adoc[`btree_set`] [.small]#[constructor]# | Constructs an empty `btree_set`. | xref:absl/btree_set/emplace-0c.adoc[`emplace`] | | xref:absl/btree_set/emplace_hint-04.adoc[`emplace_hint`] | | xref:absl/btree_set/extract-0fa.adoc[`extract`] | | xref:absl/btree_set/insert-0d.adoc[`insert`] | | xref:absl/btree_set/merge-0f8.adoc[`merge`] | |=== == Using Declarations [cols="1"] |=== | Name | xref:absl/btree_set/_10using.adoc[`Unnamed using`] | xref:absl/btree_set/begin.adoc[`begin`] | xref:absl/btree_set/cbegin.adoc[`cbegin`] | xref:absl/btree_set/cend.adoc[`cend`] | xref:absl/btree_set/clear.adoc[`clear`] | xref:absl/btree_set/contains.adoc[`contains`] | xref:absl/btree_set/count.adoc[`count`] | xref:absl/btree_set/emplace-04.adoc[`emplace`] | xref:absl/btree_set/emplace_hint-0c.adoc[`emplace_hint`] | xref:absl/btree_set/empty.adoc[`empty`] | xref:absl/btree_set/end.adoc[`end`] | xref:absl/btree_set/equal_range.adoc[`equal_range`] | xref:absl/btree_set/erase.adoc[`erase`] | xref:absl/btree_set/extract-0fc.adoc[`extract`] | xref:absl/btree_set/extract_and_get_next.adoc[`extract_and_get_next`] | xref:absl/btree_set/find.adoc[`find`] | xref:absl/btree_set/get_allocator.adoc[`get_allocator`] | xref:absl/btree_set/insert-07.adoc[`insert`] | xref:absl/btree_set/key_comp.adoc[`key_comp`] | xref:absl/btree_set/lower_bound.adoc[`lower_bound`] | xref:absl/btree_set/max_size.adoc[`max_size`] | xref:absl/btree_set/merge-02.adoc[`merge`] | xref:absl/btree_set/size.adoc[`size`] | xref:absl/btree_set/swap.adoc[`swap`] | xref:absl/btree_set/upper_bound.adoc[`upper_bound`] | xref:absl/btree_set/value_comp.adoc[`value_comp`] |=== == Protected Type Aliases [cols="1"] |=== | Name | xref:absl/btree_set/key_arg.adoc[`key_arg`] |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:absl/erase_if-014.adoc[`erase_if`] | Erases all elements that satisfy the predicate `pred` from the container. | xref:absl/swap-0ef.adoc[`swap`] | Swaps the contents of two `absl::btree_set` containers. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#