template <typename Key, typename Value, typename Compare = std::less<Key>, typename Alloc = std::allocator<std::pair<const Key, Value>>>

class btree_map

Defined at line 88 of file ../../third_party/abseil-cpp/absl/container/btree_map.h

absl::btree_map

<

>

An `absl::btree_map

<K

, V>` is an ordered associative container of

unique keys and associated values designed to be a more efficient replacement

for `std::map` (in most cases).

Keys are sorted using an (optional) comparison function, which defaults to

`std::less

<K

>`.

An `absl::btree_map

<K

, V>` uses a default allocator of

`std::allocator

<std

::pair

<const

K, V>>` 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_map

<K

, V, C, A>`.

Public Methods

void btree_map<Key, Value, Compare, Alloc> ()

Constructors and Assignment Operators

A `btree_map` supports the same overload set as `std::map`

for construction and assignment:

* Default constructor

absl::btree_map

<int

, std::string> map1;

* Initializer List constructor

absl::btree_map

<int

, std::string> map2 =

{{1, "huey"}, {2, "dewey"}, {3, "louie"},};

* Copy constructor

absl::btree_map

<int

, std::string> map3(map2);

* Copy assignment operator

absl::btree_map

<int

, std::string> map4;

map4 = map3;

* Move constructor

// Move is guaranteed efficient

absl::btree_map

<int

, std::string> map5(std::move(map4));

* Move assignment operator

// May be efficient if allocators are compatible

absl::btree_map

<int

, std::string> map6;

map6 = std::move(map5);

* Range constructor

std::vector

<std

::pair

<int

, std::string>> v = {{1, "a"}, {2, "b"}};

absl::btree_map

<int

, std::string> map7(v.begin(), v.end());

Defined at line 134 of file ../../third_party/abseil-cpp/absl/container/btree_map.h