STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Types | List of all members
__gnu_pbds::tree< Key, Mapped, Cmp_Fn, Tag, Node_Update, _Alloc > Class Template Reference

#include <ext/pb_ds/assoc_container.hpp>

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

Public Types

typedef Cmp_Fn cmp_fn
 Comparison functor type. More...
 

Public Member Functions

 tree ()
 
 tree (const cmp_fn &c)
 
template<typename It >
 tree (It first, It last)
 
template<typename It >
 tree (It first, It last, const cmp_fn &c)
 
 tree (const tree &other)
 
virtual ~tree ()
 
treeoperator= (const tree &other)
 
void swap (tree &other)
 

Private Types

typedef PB_DS_TREE_BASE base_type
 

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
KeyKey type.
MappedMap type.
Cmp_FnComparison functor.
TagInstantiating data structure type, see container_tag.
Node_UpdateUpdates tree internal-nodes, restores invariants when invalidated. XXX See design::tree-based-containers::node invariants.
_AllocAllocator type.

Base tag choices are: ov_tree_tag, rb_tree_tag, splay_tree_tag.

Base is basic_branch.

Member Typedef Documentation

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 PB_DS_TREE_BASE __gnu_pbds::tree< Key, Mapped, Cmp_Fn, Tag, Node_Update, _Alloc >::base_type
private
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.

Constructor & Destructor Documentation

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
644 { }
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.

649  : base_type(c) { }
PB_DS_TREE_BASE base_type
Definition: assoc_container.hpp:638
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.

656  { base_type::copy_from_range(first, last); }
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.

664  : base_type(c)
665  { base_type::copy_from_range(first, last); }
PB_DS_TREE_BASE base_type
Definition: assoc_container.hpp:638
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
668  : base_type((const base_type&)other) { }
PB_DS_TREE_BASE base_type
Definition: assoc_container.hpp:638
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 ( )
inlinevirtual
671 { }

Member Function Documentation

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
675  {
676  if (this != &other)
677  {
678  tree tmp(other);
679  swap(tmp);
680  }
681  return *this;
682  }
void swap(tree &other)
Definition: assoc_container.hpp:685
tree()
Definition: assoc_container.hpp:644
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
686  { base_type::swap(other); }
void swap(exception_ptr &__lhs, exception_ptr &__rhs)
Definition: exception_ptr.h:160

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