An ordered associative container of unique keys.

Synopsis

Declared in <absl/container/btree_set.h>

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

Name

Description

/* implementation-defined */::btree_set_container</* implementation-defined */::btree</* implementation-defined */>>

Type Aliases

Member Functions

Name

Description

btree_set [constructor]

Constructs an empty btree_set.

emplace

emplace_hint

extract

insert

merge

Using Declarations

Protected Type Aliases

Name

key_arg

Non-Member Functions

Name

Description

erase_if

Erases all elements that satisfy the predicate pred from the container.

swap

Swaps the contents of two absl::btree_set containers.

Created with MrDocs