| Home | Libraries | People | FAQ | More

## Boost.Container Header Reference

### Header <boost/container/adaptive_pool.hpp>

    namespace boost {
      namespace container {
        template<typename T, std::size_t NodesPerBlock = ADP_nodes_per_block,
                 std::size_t MaxFreeBlocks = ADP_max_free_blocks,
                 std::size_t OverheadPercent = ADP_overhead_percent>
          class adaptive_pool;
      }
    }

### Header <boost/container/allocator.hpp>

    namespace boost {
      namespace container {
        template<typename T, unsigned Version = 2,
                 unsigned int AllocationDisableMask = 0>
          class allocator;
      }
    }

### Header <boost/container/allocator_traits.hpp>

    namespace boost {
      namespace container {
        template<typename Allocator> struct allocator_traits;
      }
    }

### Header <boost/container/container_fwd.hpp>

This header file forward declares the following containers:

- boost::container::vector

- boost::container::stable_vector

- boost::container::static_vector

- boost::container::small_vector

- boost::container::slist

- boost::container::list

- boost::container::set

- boost::container::multiset

- boost::container::map

- boost::container::multimap

- boost::container::flat_set

- boost::container::flat_multiset

- boost::container::flat_map

- boost::container::flat_multimap

- boost::container::basic_string

- boost::container::string

- boost::container::wstring

Forward declares the following allocators:

- boost::container::allocator

- boost::container::node_allocator

- boost::container::adaptive_pool

Forward declares the following polymorphic resource classes:

- boost::container::pmr::memory_resource

- boost::container::pmr::polymorphic_allocator

- boost::container::pmr::monotonic_buffer_resource

- boost::container::pmr::pool_options

- boost::container::pmr::unsynchronized_pool_resource

- boost::container::pmr::synchronized_pool_resource

And finally it defines the following types

    namespace boost {
      namespace container {
        struct default_init_t;
        struct ordered_range_t;
        struct ordered_unique_range_t;

        enum tree_type_enum;
        typedef implementation_defined tree_assoc_defaults;

        static const ordered_range_t ordered_range;
        static const ordered_unique_range_t ordered_unique_range;
        static const default_init_t default_init;
      }
    }

### Header <boost/container/deque.hpp>

    namespace boost {
      namespace container {
        template<typename T, typename Allocator = new_allocator<T> > class deque;
      }
    }

### Header <boost/container/pmr/deque.hpp>

    namespace boost {
      namespace container {
        namespace pmr {
          template<typename T> struct deque_of;

          typedef boost::container::deque< T, polymorphic_allocator< T >> deque;
        }
      }
    }

### Header <boost/container/flat_map.hpp>

    namespace boost {
      namespace container {
        template<typename Key, typename T, typename Compare = std::less<Key>,
                 typename Allocator = new_allocator< std::pair< Key, T> > >
          class flat_map;
        template<typename Key, typename T, typename Compare = std::less<Key>,
                 typename Allocator = new_allocator< std::pair< Key, T> > >
          class flat_multimap;
      }
    }

### Header <boost/container/pmr/flat_map.hpp>

    namespace boost {
      namespace container {
        namespace pmr {
          template<typename Key, typename T, typename Compare = std::less<Key>,
                   typename Options = tree_assoc_defaults>
            struct flat_map_of;
          template<typename Key, typename T, typename Compare = std::less<Key>,
                   typename Options = tree_assoc_defaults>
            struct flat_multimap_of;

          typedef boost::container::flat_map< Key, T, Compare, polymorphic_allocator< std::pair< Key, T > > > flat_map;
          typedef boost::container::flat_multimap< Key, T, Compare, polymorphic_allocator< std::pair< Key, T > > > flat_multimap;
        }
      }
    }

### Header <boost/container/flat_set.hpp>

    namespace boost {
      namespace container {
        template<typename Key, typename Compare = std::less<Key>,
                 typename Allocator = new_allocator<Key> >
          class flat_multiset;
        template<typename Key, typename Compare = std::less<Key>,
                 typename Allocator = new_allocator<Key> >
          class flat_set;
      }
    }

### Header <boost/container/pmr/flat_set.hpp>

    namespace boost {
      namespace container {
        namespace pmr {
          template<typename Key, typename Compare = std::less<Key>,
                   typename Options = tree_assoc_defaults>
            struct flat_multiset_of;
          template<typename Key, typename Compare = std::less<Key>,
                   typename Options = tree_assoc_defaults>
            struct flat_set_of;

          typedef boost::container::flat_set< Key, Compare, polymorphic_allocator< Key > > flat_set;
          typedef boost::container::flat_multiset< Key, Compare, polymorphic_allocator< Key > > flat_multiset;
        }
      }
    }

### Header <boost/container/list.hpp>

    namespace boost {
      namespace container {
        template<typename T, typename Allocator = new_allocator<T> > class list;
      }
    }

### Header <boost/container/pmr/list.hpp>

    namespace boost {
      namespace container {
        namespace pmr {
          template<typename T> struct list_of;

          typedef boost::container::list< T, polymorphic_allocator< T >> list;
        }
      }
    }

### Header <boost/container/map.hpp>

    namespace boost {
      namespace container {
        template<typename Key, typename T, typename Compare = std::less<Key>,
                 typename Allocator = new_allocator< std::pair< const Key, T> >,
                 typename MapOptions = tree_assoc_defaults>
          class map;
        template<typename Key, typename T, typename Compare = std::less<Key>,
                 typename Allocator = new_allocator< std::pair< const Key, T> >,
                 typename MultiMapOptions = tree_assoc_defaults>
          class multimap;
      }
    }

### Header <boost/container/pmr/map.hpp>

    namespace boost {
      namespace container {
        namespace pmr {
          template<typename Key, typename T, typename Compare = std::less<Key>,
                   typename Options = tree_assoc_defaults>
            struct map_of;
          template<typename Key, typename T, typename Compare = std::less<Key>,
                   typename Options = tree_assoc_defaults>
            struct multimap_of;

          typedef boost::container::map< Key, T, Compare, polymorphic_allocator< std::pair< const Key, T > >, Options > map;
          typedef boost::container::multimap< Key, T, Compare, polymorphic_allocator< std::pair< const Key, T > >, Options > multimap;
        }
      }
    }

### Header <boost/container/new_allocator.hpp>

    namespace boost {
      namespace container {
        template<typename T> class new_allocator;

        template<> class new_allocator<void>;
      }
    }

### Header <boost/container/node_allocator.hpp>

    namespace boost {
      namespace container {
        template<typename T,
                 std::size_t NodesPerBlock = NodeAlloc_nodes_per_block>
          class node_allocator;
      }
    }

### Header <boost/container/options.hpp>

    namespace boost {
      namespace container {
        template<bool Enabled> struct optimize_size;
        template<class... Options> struct tree_assoc_options;
        template<tree_type_enum TreeType> struct tree_type;
      }
    }

### Header <boost/container/pmr/global_resource.hpp>

    namespace boost {
      namespace container {
        namespace pmr {
          memory_resource * new_delete_resource();
          memory_resource * null_memory_resource();
          memory_resource * set_default_resource(memory_resource *);
          memory_resource * get_default_resource();
        }
      }
    }

### Header <boost/container/pmr/memory_resource.hpp>

    namespace boost {
      namespace container {
        namespace pmr {
          class memory_resource;
        }
      }
    }

### Header <boost/container/pmr/monotonic_buffer_resource.hpp>

    namespace boost {
      namespace container {
        namespace pmr {
          class monotonic_buffer_resource;
        }
      }
    }

### Header <boost/container/pmr/polymorphic_allocator.hpp>

    namespace boost {
      namespace container {
        namespace pmr {
          template<typename T> class polymorphic_allocator;
          template<typename T1, typename T2>
            bool operator==(const polymorphic_allocator< T1 > &,
                            const polymorphic_allocator< T2 > &);
          template<typename T1, typename T2>
            bool operator!=(const polymorphic_allocator< T1 > &,
                            const polymorphic_allocator< T2 > &);
        }
      }
    }

### Header <boost/container/pmr/pool_options.hpp>

    namespace boost {
      namespace container {
        namespace pmr {
          struct pool_options;
        }
      }
    }

### Header <boost/container/pmr/resource_adaptor.hpp>

    namespace boost {
      namespace container {
        namespace pmr {
          template<typename Allocator> class resource_adaptor_imp;
          typedef resource_adaptor_imp< typename allocator_traits< Allocator >::template rebind_alloc< char > > resource_adaptor;
        }
      }
    }

### Header <boost/container/pmr/synchronized_pool_resource.hpp>

    namespace boost {
      namespace container {
        namespace pmr {
          class synchronized_pool_resource;
        }
      }
    }

### Header <boost/container/pmr/unsynchronized_pool_resource.hpp>

    namespace boost {
      namespace container {
        namespace pmr {
          class unsynchronized_pool_resource;
        }
      }
    }

### Header <boost/container/scoped_allocator.hpp>

    namespace boost {
      namespace container {
        template<typename OuterAlloc, typename... InnerAllocs>
          class scoped_allocator_adaptor;
        template<typename OuterA1, typename OuterA2,
                 BOOST_CONTAINER_SCOPEDALLOC_ALLINNERCLASS >
          bool operator==(const scoped_allocator_adaptor< OuterA1, InnerAllocs...> & a,
                          const scoped_allocator_adaptor< OuterA2, InnerAllocs...> & b);
        template<typename OuterA1, typename OuterA2,
                 BOOST_CONTAINER_SCOPEDALLOC_ALLINNERCLASS >
          bool operator!=(const scoped_allocator_adaptor< OuterA1, InnerAllocs...> & a,
                          const scoped_allocator_adaptor< OuterA2, InnerAllocs...> & b);
      }
    }

### Header <boost/container/scoped_allocator_fwd.hpp>

This header file forward declares boost::container::scoped_allocator_adaptor

### Header <boost/container/set.hpp>

    namespace boost {
      namespace container {
        template<typename Key, typename Compare = std::less<Key>,
                 typename Allocator = new_allocator<Key>,
                 typename MultiSetOptions = tree_assoc_defaults>
          class multiset;
        template<typename Key, typename Compare = std::less<Key>,
                 typename Allocator = new_allocator<Key>,
                 typename SetOptions = tree_assoc_defaults>
          class set;
      }
    }

### Header <boost/container/pmr/set.hpp>

    namespace boost {
      namespace container {
        namespace pmr {
          template<typename Key, typename Compare = std::less<Key>,
                   typename Options = tree_assoc_defaults>
            struct multiset_of;
          template<typename Key, typename Compare = std::less<Key>,
                   typename Options = tree_assoc_defaults>
            struct set_of;

          typedef boost::container::set< Key, Compare, polymorphic_allocator< Key >, Options > set;
          typedef boost::container::multiset< Key, Compare, polymorphic_allocator< Key >, Options > multiset;
        }
      }
    }

### Header <boost/container/slist.hpp>

    namespace boost {
      namespace container {
        template<typename T, typename Allocator = new_allocator<T> > class slist;
      }
    }namespace std {
      template<typename T, typename Allocator>
        class insert_iterator<boost::container::slist< T, Allocator >>;
    }

### Header <boost/container/pmr/slist.hpp>

    namespace boost {
      namespace container {
        namespace pmr {
          template<typename T> struct slist_of;

          typedef boost::container::slist< T, polymorphic_allocator< T >> slist;
        }
      }
    }

### Header <boost/container/small_vector.hpp>

    namespace boost {
      namespace container {
        template<typename T, std::size_t N,
                 typename Allocator = new_allocator<T> >
          class small_vector;
        template<typename Allocator> class small_vector_allocator;
        template<typename T, typename SecondaryAllocator> class small_vector_base;
      }
    }

### Header <boost/container/pmr/small_vector.hpp>

    namespace boost {
      namespace container {
        namespace pmr {
          template<typename T, std::size_t N> struct small_vector_of;

          typedef boost::container::small_vector< T, N, polymorphic_allocator< T >> small_vector;
        }
      }
    }

### Header <boost/container/stable_vector.hpp>

    namespace boost {
      namespace container {
        template<typename T, typename Allocator = new_allocator<T> >
          class stable_vector;
      }
    }

### Header <boost/container/pmr/stable_vector.hpp>

    namespace boost {
      namespace container {
        namespace pmr {
          template<typename T> struct stable_vector_of;

          typedef boost::container::stable_vector< T, polymorphic_allocator< T >> stable_vector;
        }
      }
    }

### Header <boost/container/static_vector.hpp>

    namespace boost {
      namespace container {
        template<typename Value, std::size_t Capacity> class static_vector;
        template<typename V, std::size_t C1, std::size_t C2>
          bool operator==(static_vector< V, C1 > const &,
                          static_vector< V, C2 > const &);
        template<typename V, std::size_t C1, std::size_t C2>
          bool operator!=(static_vector< V, C1 > const &,
                          static_vector< V, C2 > const &);
        template<typename V, std::size_t C1, std::size_t C2>
          bool operator<(static_vector< V, C1 > const &,
                         static_vector< V, C2 > const &);
        template<typename V, std::size_t C1, std::size_t C2>
          bool operator>(static_vector< V, C1 > const &,
                         static_vector< V, C2 > const &);
        template<typename V, std::size_t C1, std::size_t C2>
          bool operator<=(static_vector< V, C1 > const &,
                          static_vector< V, C2 > const &);
        template<typename V, std::size_t C1, std::size_t C2>
          bool operator>=(static_vector< V, C1 > const &,
                          static_vector< V, C2 > const &);
        template<typename V, std::size_t C1, std::size_t C2>
          void swap(static_vector< V, C1 > &, static_vector< V, C2 > &);
      }
    }

### Header <boost/container/string.hpp>

    namespace boost {
      namespace container {
        template<typename CharT, typename Traits = std::char_traits<CharT>,
                 typename Allocator = new_allocator<CharT> >
          class basic_string;
        typedef basic_string< char,std::char_traits< char >,new_allocator< char > > string;
        typedef basic_string< wchar_t,std::char_traits< wchar_t >,new_allocator< wchar_t > > wstring;
        template<typename CharT, typename Traits, typename Allocator>
          basic_string< CharT, Traits, Allocator >
          operator+(const basic_string< CharT, Traits, Allocator > & x,
                    const basic_string< CharT, Traits, Allocator > & y);
        template<typename CharT, typename Traits, typename Allocator>
          basic_string< CharT, Traits, Allocator >
          operator+(basic_string< CharT, Traits, Allocator > && x,
                    basic_string< CharT, Traits, Allocator > && y);
        template<typename CharT, typename Traits, typename Allocator>
          basic_string< CharT, Traits, Allocator >
          operator+(basic_string< CharT, Traits, Allocator > && x,
                    const basic_string< CharT, Traits, Allocator > & y);
        template<typename CharT, typename Traits, typename Allocator>
          basic_string< CharT, Traits, Allocator >
          operator+(const basic_string< CharT, Traits, Allocator > & x,
                    basic_string< CharT, Traits, Allocator > && y);
        template<typename CharT, typename Traits, typename Allocator>
          basic_string< CharT, Traits, Allocator >
          operator+(const CharT * s, basic_string< CharT, Traits, Allocator > y);
        template<typename CharT, typename Traits, typename Allocator>
          basic_string< CharT, Traits, Allocator >
          operator+(basic_string< CharT, Traits, Allocator > x, const CharT * s);
        template<typename CharT, typename Traits, typename Allocator>
          basic_string< CharT, Traits, Allocator >
          operator+(CharT c, basic_string< CharT, Traits, Allocator > y);
        template<typename CharT, typename Traits, typename Allocator>
          basic_string< CharT, Traits, Allocator >
          operator+(basic_string< CharT, Traits, Allocator > x, const CharT c);
        template<typename CharT, typename Traits, typename Allocator>
          bool operator==(const basic_string< CharT, Traits, Allocator > & x,
                          const basic_string< CharT, Traits, Allocator > & y);
        template<typename CharT, typename Traits, typename Allocator>
          bool operator==(const CharT * s,
                          const basic_string< CharT, Traits, Allocator > & y);
        template<typename CharT, typename Traits, typename Allocator>
          bool operator==(const basic_string< CharT, Traits, Allocator > & x,
                          const CharT * s);
        template<typename CharT, typename Traits, typename Allocator>
          bool operator!=(const basic_string< CharT, Traits, Allocator > & x,
                          const basic_string< CharT, Traits, Allocator > & y);
        template<typename CharT, typename Traits, typename Allocator>
          bool operator!=(const CharT * s,
                          const basic_string< CharT, Traits, Allocator > & y);
        template<typename CharT, typename Traits, typename Allocator>
          bool operator!=(const basic_string< CharT, Traits, Allocator > & x,
                          const CharT * s);
        template<typename CharT, typename Traits, typename Allocator>
          bool operator<(const basic_string< CharT, Traits, Allocator > & x,
                         const basic_string< CharT, Traits, Allocator > & y);
        template<typename CharT, typename Traits, typename Allocator>
          bool operator<(const CharT * s,
                         const basic_string< CharT, Traits, Allocator > & y);
        template<typename CharT, typename Traits, typename Allocator>
          bool operator<(const basic_string< CharT, Traits, Allocator > & x,
                         const CharT * s);
        template<typename CharT, typename Traits, typename Allocator>
          bool operator>(const basic_string< CharT, Traits, Allocator > & x,
                         const basic_string< CharT, Traits, Allocator > & y);
        template<typename CharT, typename Traits, typename Allocator>
          bool operator>(const CharT * s,
                         const basic_string< CharT, Traits, Allocator > & y);
        template<typename CharT, typename Traits, typename Allocator>
          bool operator>(const basic_string< CharT, Traits, Allocator > & x,
                         const CharT * s);
        template<typename CharT, typename Traits, typename Allocator>
          bool operator<=(const basic_string< CharT, Traits, Allocator > & x,
                          const basic_string< CharT, Traits, Allocator > & y);
        template<typename CharT, typename Traits, typename Allocator>
          bool operator<=(const CharT * s,
                          const basic_string< CharT, Traits, Allocator > & y);
        template<typename CharT, typename Traits, typename Allocator>
          bool operator<=(const basic_string< CharT, Traits, Allocator > & x,
                          const CharT * s);
        template<typename CharT, typename Traits, typename Allocator>
          bool operator>=(const basic_string< CharT, Traits, Allocator > & x,
                          const basic_string< CharT, Traits, Allocator > & y);
        template<typename CharT, typename Traits, typename Allocator>
          bool operator>=(const CharT * s,
                          const basic_string< CharT, Traits, Allocator > & y);
        template<typename CharT, typename Traits, typename Allocator>
          bool operator>=(const basic_string< CharT, Traits, Allocator > & x,
                          const CharT * s);
        template<typename CharT, typename Traits, typename Allocator>
          void swap(basic_string< CharT, Traits, Allocator > & x,
                    basic_string< CharT, Traits, Allocator > & y);
        template<typename CharT, typename Traits, typename Allocator>
          std::basic_ostream< CharT, Traits > &
          operator<<(std::basic_ostream< CharT, Traits > & os,
                     const basic_string< CharT, Traits, Allocator > & s);
        template<typename CharT, typename Traits, typename Allocator>
          std::basic_istream< CharT, Traits > &
          operator>>(std::basic_istream< CharT, Traits > & is,
                     basic_string< CharT, Traits, Allocator > & s);
        template<typename CharT, typename Traits, typename Allocator>
          std::basic_istream< CharT, Traits > &
          getline(std::istream & is, basic_string< CharT, Traits, Allocator > & s,
                  CharT delim);
        template<typename CharT, typename Traits, typename Allocator>
          std::basic_istream< CharT, Traits > &
          getline(std::basic_istream< CharT, Traits > & is,
                  basic_string< CharT, Traits, Allocator > & s);
        template<typename Ch, typename Allocator>
          std::size_t hash_value(basic_string< Ch, std::char_traits< Ch >, Allocator > const & v);
      }
    }

### Header <boost/container/pmr/string.hpp>

    namespace boost {
      namespace container {
        namespace pmr {
          template<typename CharT, typename Traits = std::char_traits<CharT> >
            struct basic_string_of;

          typedef boost::container::basic_string< CharT, Traits, polymorphic_allocator< CharT > > basic_string;
          typedef basic_string_of< char >::type string;
          typedef basic_string_of< wchar_t >::type wstring;
        }
      }
    }

### Header <boost/container/throw_exception.hpp>

    namespace boost {
      namespace container {
        void throw_bad_alloc();
        void throw_out_of_range(const char *);
        void throw_length_error(const char *);
        void throw_logic_error(const char *);
        void throw_runtime_error(const char *);
      }
    }

### Header <boost/container/uses_allocator.hpp>

    namespace boost {
      namespace container {
        template<typename T> struct constructible_with_allocator_prefix;
        template<typename T> struct constructible_with_allocator_suffix;
        template<typename T, typename Allocator> struct uses_allocator;
      }
    }

### Header <boost/container/uses_allocator_fwd.hpp>

This header forward declares boost::container::constructible_with_allocator_prefix, boost::container::constructible_with_allocator_suffix and boost::container::uses_allocator. Also defines the following types:

    namespace boost {
      namespace container {
        struct erased_type;
        typedef unspecified allocator_arg_t;

        static allocator_arg_t allocator_arg;
      }
    }

### Header <boost/container/vector.hpp>

    namespace boost {
      namespace container {
        template<typename T, typename Allocator = new_allocator<T> > class vector;
      }
    }

### Header <boost/container/pmr/vector.hpp>

    namespace boost {
      namespace container {
        namespace pmr {
          template<typename T> struct vector_of;

          typedef boost::container::vector< T, polymorphic_allocator< T >> vector;
        }
      }
    }