__gnu_pbds::tree< Key, Mapped, Cmp_Fn, Tag, Node_Update, _Alloc > Class Template Reference
Extensions » Policy-Based Data Structures » Containers » Branch-Based

`#include <assoc_container.hpp>`

Inheritance diagram for __gnu_pbds::tree< Key, Mapped, Cmp_Fn, Tag, Node_Update, _Alloc >:
[legend]

## Public Types

typedef Cmp_Fn | cmp_fn
typedef Node_Update | node_update

## Public Member Functions

| tree (const cmp_fn &c)
| tree (const tree &other)
template<typename It >
| tree (It first, It last)
template<typename It >
| tree (It first, It last, const cmp_fn &c)
tree & | operator= (const tree &other)
void | swap (tree &other)

## Detailed Description

template<typename Key, typename Mapped, typename Cmp_Fn = std::less<Key>, typename Tag = rb_tree_tag, template< typename Node_CItr, typename Node_Itr, typename Cmp_Fn_, typename _Alloc_ > class Node_Update = null_node_update, typename _Alloc = std::allocator<char>>
class __gnu_pbds::tree< Key, Mapped, Cmp_Fn, Tag, Node_Update, _Alloc >

A tree-based container.

Template Parameters

  Key | Key type.
  Mapped | Map type.
  Cmp_Fn | Comparison functor.
  Tag | Instantiating data structure type, see container_tag.
  Node_Update | Updates tree internal-nodes, restores invariants when invalidated. XXX See design::tree-based-containersnode invariants.
  _Alloc | Allocator type.

Base tag choices are: ov_tree_tag, rb_tree_tag, splay_tree_tag.

Base is basic_branch.

Definition at line 635 of file assoc_container.hpp.

## Member Typedef Documentation

## cmp_fn

template<typename Key , typename Mapped , typename Cmp_Fn = std::less<Key>, typename Tag = rb_tree_tag, template< typename Node_CItr, typename Node_Itr, typename Cmp_Fn_, typename _Alloc_ > class Node_Update = null_node_update, typename _Alloc = std::allocator<char>>

typedef Cmp_Fn __gnu_pbds::tree< Key, Mapped, Cmp_Fn, Tag, Node_Update, _Alloc >::cmp_fn

Comparison functor type.

Definition at line 642 of file assoc_container.hpp.

## node_update

template<typename Key , typename Mapped , typename Tag , typename Node_Update , typename Policy_Tl , typename _Alloc >

typedef Node_Update __gnu_pbds::basic_branch< Key, Mapped, Tag, Node_Update, Policy_Tl, _Alloc >::node_update

inherited

Definition at line 561 of file assoc_container.hpp.

## Constructor & Destructor Documentation

## tree() [1/5]

template<typename Key , typename Mapped , typename Cmp_Fn = std::less<Key>, typename Tag = rb_tree_tag, template< typename Node_CItr, typename Node_Itr, typename Cmp_Fn_, typename _Alloc_ > class Node_Update = null_node_update, typename _Alloc = std::allocator<char>>

__gnu_pbds::tree< Key, Mapped, Cmp_Fn, Tag, Node_Update, _Alloc >::tree | ( |  | ) |

inline

Definition at line 644 of file assoc_container.hpp.

## tree() [2/5]

template<typename Key , typename Mapped , typename Cmp_Fn = std::less<Key>, typename Tag = rb_tree_tag, template< typename Node_CItr, typename Node_Itr, typename Cmp_Fn_, typename _Alloc_ > class Node_Update = null_node_update, typename _Alloc = std::allocator<char>>

__gnu_pbds::tree< Key, Mapped, Cmp_Fn, Tag, Node_Update, _Alloc >::tree | ( | const cmp_fn & | c | ) |

inline

Constructor taking some policy objects. r_cmp_fn will be copied by the Cmp_Fn object of the container object.

Definition at line 648 of file assoc_container.hpp.

## tree() [3/5]

template<typename Key , typename Mapped , typename Cmp_Fn = std::less<Key>, typename Tag = rb_tree_tag, template< typename Node_CItr, typename Node_Itr, typename Cmp_Fn_, typename _Alloc_ > class Node_Update = null_node_update, typename _Alloc = std::allocator<char>>
template<typename It >

__gnu_pbds::tree< Key, Mapped, Cmp_Fn, Tag, Node_Update, _Alloc >::tree | ( | It | first,
|  | It | last
| ) |  |

inline

Constructor taking __iterators to a range of value_types. The value_types between first_it and last_it will be inserted into the container object.

Definition at line 655 of file assoc_container.hpp.

## tree() [4/5]

template<typename Key , typename Mapped , typename Cmp_Fn = std::less<Key>, typename Tag = rb_tree_tag, template< typename Node_CItr, typename Node_Itr, typename Cmp_Fn_, typename _Alloc_ > class Node_Update = null_node_update, typename _Alloc = std::allocator<char>>
template<typename It >

__gnu_pbds::tree< Key, Mapped, Cmp_Fn, Tag, Node_Update, _Alloc >::tree | ( | It | first,
|  | It | last,
|  | const cmp_fn & | c
| ) |  |

inline

Constructor taking __iterators to a range of value_types and some policy objects The value_types between first_it and last_it will be inserted into the container object. r_cmp_fn will be copied by the cmp_fn object of the container object.

Definition at line 663 of file assoc_container.hpp.

## tree() [5/5]

template<typename Key , typename Mapped , typename Cmp_Fn = std::less<Key>, typename Tag = rb_tree_tag, template< typename Node_CItr, typename Node_Itr, typename Cmp_Fn_, typename _Alloc_ > class Node_Update = null_node_update, typename _Alloc = std::allocator<char>>

__gnu_pbds::tree< Key, Mapped, Cmp_Fn, Tag, Node_Update, _Alloc >::tree | ( | const tree< Key, Mapped, Cmp_Fn, Tag, Node_Update, _Alloc > & | other | ) |

inline

Definition at line 667 of file assoc_container.hpp.

## ~tree()

template<typename Key , typename Mapped , typename Cmp_Fn = std::less<Key>, typename Tag = rb_tree_tag, template< typename Node_CItr, typename Node_Itr, typename Cmp_Fn_, typename _Alloc_ > class Node_Update = null_node_update, typename _Alloc = std::allocator<char>>

virtual __gnu_pbds::tree< Key, Mapped, Cmp_Fn, Tag, Node_Update, _Alloc >::~tree | ( |  | ) |

inline virtual

Definition at line 671 of file assoc_container.hpp.

## Member Function Documentation

## operator=()

template<typename Key , typename Mapped , typename Cmp_Fn = std::less<Key>, typename Tag = rb_tree_tag, template< typename Node_CItr, typename Node_Itr, typename Cmp_Fn_, typename _Alloc_ > class Node_Update = null_node_update, typename _Alloc = std::allocator<char>>

tree & __gnu_pbds::tree< Key, Mapped, Cmp_Fn, Tag, Node_Update, _Alloc >::operator= | ( | const tree< Key, Mapped, Cmp_Fn, Tag, Node_Update, _Alloc > & | other | ) |

inline

Definition at line 674 of file assoc_container.hpp.

## swap()

template<typename Key , typename Mapped , typename Cmp_Fn = std::less<Key>, typename Tag = rb_tree_tag, template< typename Node_CItr, typename Node_Itr, typename Cmp_Fn_, typename _Alloc_ > class Node_Update = null_node_update, typename _Alloc = std::allocator<char>>

void __gnu_pbds::tree< Key, Mapped, Cmp_Fn, Tag, Node_Update, _Alloc >::swap | ( | tree< Key, Mapped, Cmp_Fn, Tag, Node_Update, _Alloc > & | other | ) |

inline

Definition at line 685 of file assoc_container.hpp.

The documentation for this class was generated from the following file:

- assoc_container.hpp