mirror of
https://github.com/boostorg/multi_index.git
synced 2025-05-10 07:24:01 +00:00
refactored 91f21167118564daedafb0224132f7b2b6651e05
This commit is contained in:
parent
9acee043bc
commit
c57a6771fd
@ -73,6 +73,7 @@ Acknowledgements
|
|||||||
for motivation). For the moment being, this change is <i>not</i>
|
for motivation). For the moment being, this change is <i>not</i>
|
||||||
documented in the reference section (i.e., it has semi-official status).
|
documented in the reference section (i.e., it has semi-official status).
|
||||||
</li>
|
</li>
|
||||||
|
<li>Maintenance work.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@ -617,7 +618,7 @@ Acknowledgements
|
|||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<p>Revised December 29th 2018</p>
|
<p>Revised December 30th 2018</p>
|
||||||
|
|
||||||
<p>© Copyright 2003-2018 Joaquín M López Muñoz.
|
<p>© Copyright 2003-2018 Joaquín M López Muñoz.
|
||||||
Distributed under the Boost Software
|
Distributed under the Boost Software
|
||||||
|
104
include/boost/multi_index/detail/allocator_traits.hpp
Normal file
104
include/boost/multi_index/detail/allocator_traits.hpp
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
/* Copyright 2003-2018 Joaquin M Lopez Munoz.
|
||||||
|
* Distributed under the Boost Software License, Version 1.0.
|
||||||
|
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
* http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
*
|
||||||
|
* See http://www.boost.org/libs/multi_index for library home page.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef BOOST_MULTI_INDEX_DETAIL_ALLOCATOR_TRAITS_HPP
|
||||||
|
#define BOOST_MULTI_INDEX_DETAIL_ALLOCATOR_TRAITS_HPP
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||||
|
#include <memory>
|
||||||
|
#else
|
||||||
|
#include <boost/core/pointer_traits.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace boost{
|
||||||
|
|
||||||
|
namespace multi_index{
|
||||||
|
|
||||||
|
namespace detail{
|
||||||
|
|
||||||
|
/* poor man's replacement of std::allocator_traits */
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||||
|
|
||||||
|
template<typename Allocator>
|
||||||
|
struct allocator_traits:std::allocator_traits<Allocator>
|
||||||
|
{
|
||||||
|
/* wrap std::allocator_traits alias templates for use in C++03 codebase */
|
||||||
|
|
||||||
|
typedef std::allocator_traits<Allocator> super;
|
||||||
|
|
||||||
|
template<typename U>
|
||||||
|
struct rebind_alloc
|
||||||
|
{
|
||||||
|
typedef typename super::template rebind_alloc<U> type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename U>
|
||||||
|
struct rebind_traits
|
||||||
|
{
|
||||||
|
typedef typename super::template rebind_traits<U> type;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
/* not a full std::allocator_traits rewrite (not needed) */
|
||||||
|
|
||||||
|
template<typename Allocator>
|
||||||
|
struct allocator_traits
|
||||||
|
{
|
||||||
|
|
||||||
|
typedef Allocator allocator_type;
|
||||||
|
typedef typename Allocator::value_type value_type;
|
||||||
|
typedef typename Allocator::pointer pointer;
|
||||||
|
typedef typename Allocator::const_pointer const_pointer;
|
||||||
|
typedef typename pointer_traits<pointer>::
|
||||||
|
template rebind_to<void>::type void_pointer;
|
||||||
|
typedef typename pointer_traits<pointer>::
|
||||||
|
template rebind_to<const void>::type const_void_pointer;
|
||||||
|
typedef typename Allocator::value_type value_type;
|
||||||
|
typedef typename Allocator::size_type size_type;
|
||||||
|
typedef typename Allocator::difference_type difference_type;
|
||||||
|
|
||||||
|
template<typename U>
|
||||||
|
struct rebind_alloc
|
||||||
|
{
|
||||||
|
typedef typename Allocator::template rebind<U>::other type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename U>
|
||||||
|
struct rebind_traits
|
||||||
|
{
|
||||||
|
typedef allocator_traits<typename rebind_alloc<U>::type> type;
|
||||||
|
};
|
||||||
|
|
||||||
|
static pointer allocate(Allocator& a,size_type n){return a.allocate(n);}
|
||||||
|
static pointer allocate(Allocator& a,size_type n,const_void_pointer p)
|
||||||
|
{return a.allocate(n.static_cast<const_pointer>(p));}
|
||||||
|
static void deallocate(Allocator& a,pointer p,size_type n)
|
||||||
|
{a.deallocate(p,n);}
|
||||||
|
static void construct(Allocator& a,pointer p,const value_type& x)
|
||||||
|
{a.construct(p,x);}
|
||||||
|
static size_type max_size(Allocator& a)BOOST_NOEXCEPT{return a.max_size();}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
} /* namespace multi_index::detail */
|
||||||
|
|
||||||
|
} /* namespace multi_index */
|
||||||
|
|
||||||
|
} /* namespace boost */
|
||||||
|
|
||||||
|
#endif
|
@ -17,8 +17,8 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <boost/detail/allocator_utilities.hpp>
|
#include <boost/detail/allocator_utilities.hpp>
|
||||||
#include <boost/multi_index/detail/adl_swap.hpp>
|
#include <boost/multi_index/detail/adl_swap.hpp>
|
||||||
|
#include <boost/multi_index/detail/allocator_traits.hpp>
|
||||||
#include <boost/noncopyable.hpp>
|
#include <boost/noncopyable.hpp>
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
namespace boost{
|
namespace boost{
|
||||||
|
|
||||||
@ -47,34 +47,16 @@ struct auto_space:private noncopyable
|
|||||||
{
|
{
|
||||||
typedef typename boost::detail::allocator::rebind_to<
|
typedef typename boost::detail::allocator::rebind_to<
|
||||||
Allocator,T
|
Allocator,T
|
||||||
>::type allocator;
|
>::type allocator;
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
typedef allocator_traits<allocator> alloc_traits;
|
||||||
typedef typename allocator::pointer pointer;
|
typedef typename alloc_traits::pointer pointer;
|
||||||
typedef typename allocator::size_type size_type;
|
typedef typename alloc_traits::size_type size_type;
|
||||||
#else
|
|
||||||
typedef std::allocator_traits<allocator> traits;
|
|
||||||
typedef typename traits::pointer pointer;
|
|
||||||
typedef typename traits::size_type size_type;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
explicit auto_space(const Allocator& al=Allocator(),size_type n=1):
|
explicit auto_space(const Allocator& al=Allocator(),size_type n=1):
|
||||||
al_(al),n_(n),
|
al_(al),n_(n),data_(n_?alloc_traits::allocate(al_,n_):pointer(0))
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
|
||||||
data_(n_?al_.allocate(n_):pointer(0))
|
|
||||||
#else
|
|
||||||
data_(n_?traits::allocate(al_,n_):pointer(0))
|
|
||||||
#endif
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
~auto_space()
|
~auto_space(){if(n_)alloc_traits::deallocate(al_,data_,n_);}
|
||||||
{
|
|
||||||
if(n_)
|
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
|
||||||
al_.deallocate(data_,n_);
|
|
||||||
#else
|
|
||||||
traits::deallocate(al_,data_,n_);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
Allocator get_allocator()const{return al_;}
|
Allocator get_allocator()const{return al_;}
|
||||||
|
|
||||||
|
@ -18,11 +18,10 @@
|
|||||||
#include <boost/core/addressof.hpp>
|
#include <boost/core/addressof.hpp>
|
||||||
#include <boost/detail/no_exceptions_support.hpp>
|
#include <boost/detail/no_exceptions_support.hpp>
|
||||||
#include <boost/multi_index/detail/auto_space.hpp>
|
#include <boost/multi_index/detail/auto_space.hpp>
|
||||||
|
#include <boost/multi_index/detail/allocator_traits.hpp>
|
||||||
#include <boost/multi_index/detail/raw_ptr.hpp>
|
#include <boost/multi_index/detail/raw_ptr.hpp>
|
||||||
#include <boost/noncopyable.hpp>
|
#include <boost/noncopyable.hpp>
|
||||||
#include <cstddef>
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
namespace boost{
|
namespace boost{
|
||||||
|
|
||||||
@ -59,14 +58,15 @@ struct copy_map_entry
|
|||||||
template <typename Node,typename Allocator>
|
template <typename Node,typename Allocator>
|
||||||
class copy_map:private noncopyable
|
class copy_map:private noncopyable
|
||||||
{
|
{
|
||||||
|
typedef typename boost::detail::allocator::rebind_to<
|
||||||
|
Allocator,Node
|
||||||
|
>::type allocator_type;
|
||||||
|
typedef allocator_traits<allocator_type> alloc_traits;
|
||||||
|
typedef typename alloc_traits::pointer pointer;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef const copy_map_entry<Node>* const_iterator;
|
typedef const copy_map_entry<Node>* const_iterator;
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
typedef typename alloc_traits::size_type size_type;
|
||||||
typedef typename Allocator::size_type size_type;
|
|
||||||
#else
|
|
||||||
typedef std::allocator_traits<Allocator> traits;
|
|
||||||
typedef typename traits::size_type size_type;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
copy_map(
|
copy_map(
|
||||||
const Allocator& al,size_type size,Node* header_org,Node* header_cpy):
|
const Allocator& al,size_type size,Node* header_org,Node* header_cpy):
|
||||||
@ -123,40 +123,22 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef typename boost::detail::allocator::rebind_to<
|
allocator_type al_;
|
||||||
Allocator,Node
|
size_type size_;
|
||||||
>::type allocator_type;
|
auto_space<copy_map_entry<Node>,Allocator> spc;
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
size_type n;
|
||||||
typedef typename allocator_type::pointer allocator_pointer;
|
Node* header_org_;
|
||||||
#else
|
Node* header_cpy_;
|
||||||
typedef std::allocator_traits<allocator_type> allocator_traits;
|
bool released;
|
||||||
typedef typename allocator_traits::pointer allocator_pointer;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
allocator_type al_;
|
pointer allocate()
|
||||||
size_type size_;
|
|
||||||
auto_space<copy_map_entry<Node>,Allocator> spc;
|
|
||||||
size_type n;
|
|
||||||
Node* header_org_;
|
|
||||||
Node* header_cpy_;
|
|
||||||
bool released;
|
|
||||||
|
|
||||||
allocator_pointer allocate()
|
|
||||||
{
|
{
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
return alloc_traits::allocate(al_,1);
|
||||||
return al_.allocate(1);
|
|
||||||
#else
|
|
||||||
return allocator_traits::allocate(al_,1);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void deallocate(Node* node)
|
void deallocate(Node* node)
|
||||||
{
|
{
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
alloc_traits::deallocate(al_,static_cast<pointer>(node),1);
|
||||||
al_.deallocate(static_cast<allocator_pointer>(node),1);
|
|
||||||
#else
|
|
||||||
allocator_traits::deallocate(al_,static_cast<allocator_pointer>(node),1);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||||
#include <cstddef>
|
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
|
||||||
namespace boost{
|
namespace boost{
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
|
|
||||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||||
#include <boost/detail/allocator_utilities.hpp>
|
#include <boost/detail/allocator_utilities.hpp>
|
||||||
|
#include <boost/multi_index/detail/allocator_traits.hpp>
|
||||||
#include <boost/multi_index/detail/raw_ptr.hpp>
|
#include <boost/multi_index/detail/raw_ptr.hpp>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
namespace boost{
|
namespace boost{
|
||||||
|
|
||||||
@ -103,31 +103,19 @@ struct hashed_index_base_node_impl
|
|||||||
typedef typename
|
typedef typename
|
||||||
boost::detail::allocator::rebind_to<
|
boost::detail::allocator::rebind_to<
|
||||||
Allocator,hashed_index_base_node_impl
|
Allocator,hashed_index_base_node_impl
|
||||||
>::type base_allocator;
|
>::type base_allocator;
|
||||||
typedef typename
|
typedef typename
|
||||||
boost::detail::allocator::rebind_to<
|
boost::detail::allocator::rebind_to<
|
||||||
Allocator,
|
Allocator,
|
||||||
hashed_index_node_impl<Allocator>
|
hashed_index_node_impl<Allocator>
|
||||||
>::type node_allocator;
|
>::type node_allocator;
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
typedef allocator_traits<base_allocator> base_alloc_traits;
|
||||||
typedef typename base_allocator::pointer base_pointer;
|
typedef allocator_traits<node_allocator> node_alloc_traits;
|
||||||
typedef typename base_allocator::const_pointer const_base_pointer;
|
typedef typename base_alloc_traits::pointer base_pointer;
|
||||||
typedef typename node_allocator::pointer pointer;
|
typedef typename base_alloc_traits::const_pointer const_base_pointer;
|
||||||
typedef typename node_allocator::const_pointer const_pointer;
|
typedef typename node_alloc_traits::pointer pointer;
|
||||||
typedef typename node_allocator::difference_type difference_type;
|
typedef typename node_alloc_traits::const_pointer const_pointer;
|
||||||
#else
|
typedef typename node_alloc_traits::difference_type difference_type;
|
||||||
typedef std::allocator_traits<base_allocator> base_allocator_traits;
|
|
||||||
typedef std::allocator_traits<node_allocator> node_allocator_traits;
|
|
||||||
|
|
||||||
typedef typename base_allocator_traits::pointer base_pointer;
|
|
||||||
typedef typename base_allocator_traits::
|
|
||||||
const_pointer const_base_pointer;
|
|
||||||
typedef typename node_allocator_traits::pointer pointer;
|
|
||||||
typedef typename node_allocator_traits::
|
|
||||||
const_pointer const_pointer;
|
|
||||||
typedef typename node_allocator_traits::
|
|
||||||
difference_type difference_type;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
pointer& prior(){return prior_;}
|
pointer& prior(){return prior_;}
|
||||||
pointer prior()const{return prior_;}
|
pointer prior()const{return prior_;}
|
||||||
|
@ -21,13 +21,13 @@
|
|||||||
#include <boost/move/core.hpp>
|
#include <boost/move/core.hpp>
|
||||||
#include <boost/move/utility.hpp>
|
#include <boost/move/utility.hpp>
|
||||||
#include <boost/mpl/vector.hpp>
|
#include <boost/mpl/vector.hpp>
|
||||||
|
#include <boost/multi_index/detail/allocator_traits.hpp>
|
||||||
#include <boost/multi_index/detail/copy_map.hpp>
|
#include <boost/multi_index/detail/copy_map.hpp>
|
||||||
#include <boost/multi_index/detail/do_not_copy_elements_tag.hpp>
|
#include <boost/multi_index/detail/do_not_copy_elements_tag.hpp>
|
||||||
#include <boost/multi_index/detail/node_type.hpp>
|
#include <boost/multi_index/detail/node_type.hpp>
|
||||||
#include <boost/multi_index/detail/vartempl_support.hpp>
|
#include <boost/multi_index/detail/vartempl_support.hpp>
|
||||||
#include <boost/multi_index_container_fwd.hpp>
|
#include <boost/multi_index_container_fwd.hpp>
|
||||||
#include <boost/tuple/tuple.hpp>
|
#include <boost/tuple/tuple.hpp>
|
||||||
#include <memory>
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
|
#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
|
||||||
@ -87,12 +87,8 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
typedef Value value_type;
|
typedef Value value_type;
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
typedef allocator_traits<Allocator> alloc_traits;
|
||||||
typedef typename Allocator::size_type size_type;
|
typedef typename alloc_traits::size_type size_type;
|
||||||
#else
|
|
||||||
typedef std::allocator_traits<Allocator> traits;
|
|
||||||
typedef typename traits::size_type size_type;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit index_base(const ctor_args_list&,const Allocator&){}
|
explicit index_base(const ctor_args_list&,const Allocator&){}
|
||||||
|
@ -53,6 +53,7 @@
|
|||||||
#include <boost/mpl/if.hpp>
|
#include <boost/mpl/if.hpp>
|
||||||
#include <boost/mpl/push_front.hpp>
|
#include <boost/mpl/push_front.hpp>
|
||||||
#include <boost/multi_index/detail/access_specifier.hpp>
|
#include <boost/multi_index/detail/access_specifier.hpp>
|
||||||
|
#include <boost/multi_index/detail/allocator_traits.hpp>
|
||||||
#include <boost/multi_index/detail/bidir_node_iterator.hpp>
|
#include <boost/multi_index/detail/bidir_node_iterator.hpp>
|
||||||
#include <boost/multi_index/detail/do_not_copy_elements_tag.hpp>
|
#include <boost/multi_index/detail/do_not_copy_elements_tag.hpp>
|
||||||
#include <boost/multi_index/detail/index_node_base.hpp>
|
#include <boost/multi_index/detail/index_node_base.hpp>
|
||||||
@ -69,7 +70,6 @@
|
|||||||
#include <boost/tuple/tuple.hpp>
|
#include <boost/tuple/tuple.hpp>
|
||||||
#include <boost/type_traits/is_same.hpp>
|
#include <boost/type_traits/is_same.hpp>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||||
#include <initializer_list>
|
#include <initializer_list>
|
||||||
@ -163,13 +163,8 @@ public:
|
|||||||
value_type,KeyFromValue,Compare> value_compare;
|
value_type,KeyFromValue,Compare> value_compare;
|
||||||
typedef tuple<key_from_value,key_compare> ctor_args;
|
typedef tuple<key_from_value,key_compare> ctor_args;
|
||||||
typedef typename super::final_allocator_type allocator_type;
|
typedef typename super::final_allocator_type allocator_type;
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
|
||||||
typedef typename allocator_type::reference reference;
|
|
||||||
typedef typename allocator_type::const_reference const_reference;
|
|
||||||
#else
|
|
||||||
typedef value_type& reference;
|
typedef value_type& reference;
|
||||||
typedef const value_type& const_reference;
|
typedef const value_type& const_reference;
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
||||||
typedef safe_mode::safe_iterator<
|
typedef safe_mode::safe_iterator<
|
||||||
@ -181,18 +176,14 @@ public:
|
|||||||
|
|
||||||
typedef iterator const_iterator;
|
typedef iterator const_iterator;
|
||||||
|
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
private:
|
||||||
typedef typename allocator_type::size_type size_type;
|
typedef allocator_traits<allocator_type> alloc_traits;
|
||||||
typedef typename allocator_type::difference_type difference_type;
|
|
||||||
typedef typename allocator_type::pointer pointer;
|
public:
|
||||||
typedef typename allocator_type::const_pointer const_pointer;
|
typedef typename alloc_traits::size_type size_type;
|
||||||
#else
|
typedef typename alloc_traits::difference_type difference_type;
|
||||||
typedef std::allocator_traits<allocator_type> allocator_traits;
|
typedef typename alloc_traits::pointer pointer;
|
||||||
typedef typename allocator_traits::size_type size_type;
|
typedef typename alloc_traits::const_pointer const_pointer;
|
||||||
typedef typename allocator_traits::difference_type difference_type;
|
|
||||||
typedef typename allocator_traits::pointer pointer;
|
|
||||||
typedef typename allocator_traits::const_pointer const_pointer;
|
|
||||||
#endif
|
|
||||||
typedef typename
|
typedef typename
|
||||||
boost::reverse_iterator<iterator> reverse_iterator;
|
boost::reverse_iterator<iterator> reverse_iterator;
|
||||||
typedef typename
|
typedef typename
|
||||||
|
@ -42,8 +42,8 @@
|
|||||||
|
|
||||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <memory>
|
|
||||||
#include <boost/detail/allocator_utilities.hpp>
|
#include <boost/detail/allocator_utilities.hpp>
|
||||||
|
#include <boost/multi_index/detail/allocator_traits.hpp>
|
||||||
#include <boost/multi_index/detail/raw_ptr.hpp>
|
#include <boost/multi_index/detail/raw_ptr.hpp>
|
||||||
|
|
||||||
#if !defined(BOOST_MULTI_INDEX_DISABLE_COMPRESSED_ORDERED_INDEX_NODES)
|
#if !defined(BOOST_MULTI_INDEX_DISABLE_COMPRESSED_ORDERED_INDEX_NODES)
|
||||||
@ -76,18 +76,11 @@ struct ordered_index_node_traits
|
|||||||
Allocator,
|
Allocator,
|
||||||
ordered_index_node_impl<AugmentPolicy,Allocator>
|
ordered_index_node_impl<AugmentPolicy,Allocator>
|
||||||
>::type allocator;
|
>::type allocator;
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
typedef allocator_traits<allocator> alloc_traits;
|
||||||
typedef typename allocator::pointer pointer;
|
typedef typename alloc_traits::pointer pointer;
|
||||||
typedef typename allocator::const_pointer const_pointer;
|
typedef typename alloc_traits::const_pointer const_pointer;
|
||||||
typedef typename allocator::difference_type difference_type;
|
typedef typename alloc_traits::difference_type difference_type;
|
||||||
typedef typename allocator::size_type size_type;
|
typedef typename alloc_traits::size_type size_type;
|
||||||
#else
|
|
||||||
typedef std::allocator_traits<allocator> allocator_traits;
|
|
||||||
typedef typename allocator_traits::pointer pointer;
|
|
||||||
typedef typename allocator_traits::const_pointer const_pointer;
|
|
||||||
typedef typename allocator_traits::difference_type difference_type;
|
|
||||||
typedef typename allocator_traits::size_type size_type;
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename AugmentPolicy,typename Allocator>
|
template<typename AugmentPolicy,typename Allocator>
|
||||||
|
@ -16,11 +16,10 @@
|
|||||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <boost/detail/allocator_utilities.hpp>
|
#include <boost/detail/allocator_utilities.hpp>
|
||||||
|
#include <boost/multi_index/detail/allocator_traits.hpp>
|
||||||
#include <boost/multi_index/detail/auto_space.hpp>
|
#include <boost/multi_index/detail/auto_space.hpp>
|
||||||
#include <boost/multi_index/detail/rnd_index_ptr_array.hpp>
|
#include <boost/multi_index/detail/rnd_index_ptr_array.hpp>
|
||||||
#include <boost/noncopyable.hpp>
|
#include <boost/noncopyable.hpp>
|
||||||
#include <cstddef>
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
namespace boost{
|
namespace boost{
|
||||||
|
|
||||||
@ -95,12 +94,8 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
typedef allocator_traits<Allocator> alloc_traits;
|
||||||
typedef typename Allocator::size_type size_type;
|
typedef typename alloc_traits::size_type size_type;
|
||||||
#else
|
|
||||||
typedef std::allocator_traits<Allocator> allocator_traits;
|
|
||||||
typedef typename allocator_traits::size_type size_type;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void preprocess()
|
void preprocess()
|
||||||
{
|
{
|
||||||
|
@ -17,10 +17,10 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <boost/detail/allocator_utilities.hpp>
|
#include <boost/detail/allocator_utilities.hpp>
|
||||||
#include <boost/integer/common_factor_rt.hpp>
|
#include <boost/integer/common_factor_rt.hpp>
|
||||||
|
#include <boost/multi_index/detail/allocator_traits.hpp>
|
||||||
#include <boost/multi_index/detail/raw_ptr.hpp>
|
#include <boost/multi_index/detail/raw_ptr.hpp>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
namespace boost{
|
namespace boost{
|
||||||
|
|
||||||
@ -34,27 +34,18 @@ struct random_access_index_node_impl
|
|||||||
typedef typename
|
typedef typename
|
||||||
boost::detail::allocator::rebind_to<
|
boost::detail::allocator::rebind_to<
|
||||||
Allocator,random_access_index_node_impl
|
Allocator,random_access_index_node_impl
|
||||||
>::type node_allocator;
|
>::type node_allocator;
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
typedef allocator_traits<node_allocator> node_alloc_traits;
|
||||||
typedef typename node_allocator::pointer pointer;
|
typedef typename node_alloc_traits::pointer pointer;
|
||||||
typedef typename node_allocator::const_pointer const_pointer;
|
typedef typename node_alloc_traits::const_pointer const_pointer;
|
||||||
typedef typename node_allocator::difference_type difference_type;
|
typedef typename node_alloc_traits::difference_type difference_type;
|
||||||
#else
|
|
||||||
typedef std::allocator_traits<node_allocator> node_traits;
|
|
||||||
typedef typename node_traits::pointer pointer;
|
|
||||||
typedef typename node_traits::const_pointer const_pointer;
|
|
||||||
typedef typename node_traits::difference_type difference_type;
|
|
||||||
#endif
|
|
||||||
typedef typename
|
typedef typename
|
||||||
boost::detail::allocator::rebind_to<
|
boost::detail::allocator::rebind_to<
|
||||||
Allocator,pointer
|
Allocator,pointer
|
||||||
>::type ptr_allocator;
|
>::type ptr_allocator;
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
typedef allocator_traits<ptr_allocator> ptr_alloc_traits;
|
||||||
typedef typename ptr_allocator::pointer ptr_pointer;
|
typedef typename ptr_alloc_traits::pointer ptr_pointer;
|
||||||
#else
|
|
||||||
typedef std::allocator_traits<ptr_allocator> ptr_traits;
|
|
||||||
typedef typename ptr_traits::pointer ptr_pointer;
|
|
||||||
#endif
|
|
||||||
ptr_pointer& up(){return up_;}
|
ptr_pointer& up(){return up_;}
|
||||||
ptr_pointer up()const{return up_;}
|
ptr_pointer up()const{return up_;}
|
||||||
|
|
||||||
|
@ -16,11 +16,10 @@
|
|||||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <boost/detail/allocator_utilities.hpp>
|
#include <boost/detail/allocator_utilities.hpp>
|
||||||
|
#include <boost/multi_index/detail/allocator_traits.hpp>
|
||||||
#include <boost/multi_index/detail/auto_space.hpp>
|
#include <boost/multi_index/detail/auto_space.hpp>
|
||||||
#include <boost/multi_index/detail/rnd_index_node.hpp>
|
#include <boost/multi_index/detail/rnd_index_node.hpp>
|
||||||
#include <boost/noncopyable.hpp>
|
#include <boost/noncopyable.hpp>
|
||||||
#include <cstddef>
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
namespace boost{
|
namespace boost{
|
||||||
|
|
||||||
@ -45,14 +44,9 @@ public:
|
|||||||
typedef typename boost::detail::allocator::rebind_to<
|
typedef typename boost::detail::allocator::rebind_to<
|
||||||
Allocator,value_type
|
Allocator,value_type
|
||||||
>::type value_allocator;
|
>::type value_allocator;
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
typedef allocator_traits<value_allocator> alloc_traits;
|
||||||
typedef typename value_allocator::pointer pointer;
|
typedef typename alloc_traits::pointer pointer;
|
||||||
typedef typename value_allocator::size_type size_type;
|
typedef typename alloc_traits::size_type size_type;
|
||||||
#else
|
|
||||||
typedef std::allocator_traits<value_allocator> allocator_traits;
|
|
||||||
typedef typename allocator_traits::pointer pointer;
|
|
||||||
typedef typename allocator_traits::size_type size_type;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
random_access_index_ptr_array(
|
random_access_index_ptr_array(
|
||||||
const Allocator& al,value_type end_,size_type sz):
|
const Allocator& al,value_type end_,size_type sz):
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
|
|
||||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <memory>
|
|
||||||
#include <boost/detail/allocator_utilities.hpp>
|
#include <boost/detail/allocator_utilities.hpp>
|
||||||
|
#include <boost/multi_index/detail/allocator_traits.hpp>
|
||||||
#include <boost/multi_index/detail/raw_ptr.hpp>
|
#include <boost/multi_index/detail/raw_ptr.hpp>
|
||||||
|
|
||||||
namespace boost{
|
namespace boost{
|
||||||
@ -33,17 +33,12 @@ struct sequenced_index_node_impl
|
|||||||
typedef typename
|
typedef typename
|
||||||
boost::detail::allocator::rebind_to<
|
boost::detail::allocator::rebind_to<
|
||||||
Allocator,sequenced_index_node_impl
|
Allocator,sequenced_index_node_impl
|
||||||
>::type node_allocator;
|
>::type node_allocator;
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
typedef allocator_traits<node_allocator> alloc_traits;
|
||||||
typedef typename node_allocator::pointer pointer;
|
typedef typename alloc_traits::pointer pointer;
|
||||||
typedef typename node_allocator::const_pointer const_pointer;
|
typedef typename alloc_traits::const_pointer const_pointer;
|
||||||
typedef typename node_allocator::difference_type difference_type;
|
typedef typename alloc_traits::difference_type difference_type;
|
||||||
#else
|
|
||||||
typedef std::allocator_traits<node_allocator> allocator_traits;
|
|
||||||
typedef typename allocator_traits::pointer pointer;
|
|
||||||
typedef typename allocator_traits::const_pointer const_pointer;
|
|
||||||
typedef typename allocator_traits::difference_type difference_type;
|
|
||||||
#endif
|
|
||||||
pointer& prior(){return prior_;}
|
pointer& prior(){return prior_;}
|
||||||
pointer prior()const{return prior_;}
|
pointer prior()const{return prior_;}
|
||||||
pointer& next(){return next_;}
|
pointer& next(){return next_;}
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include <boost/mpl/if.hpp>
|
#include <boost/mpl/if.hpp>
|
||||||
#include <boost/mpl/push_front.hpp>
|
#include <boost/mpl/push_front.hpp>
|
||||||
#include <boost/multi_index/detail/access_specifier.hpp>
|
#include <boost/multi_index/detail/access_specifier.hpp>
|
||||||
|
#include <boost/multi_index/detail/allocator_traits.hpp>
|
||||||
#include <boost/multi_index/detail/auto_space.hpp>
|
#include <boost/multi_index/detail/auto_space.hpp>
|
||||||
#include <boost/multi_index/detail/bucket_array.hpp>
|
#include <boost/multi_index/detail/bucket_array.hpp>
|
||||||
#include <boost/multi_index/detail/do_not_copy_elements_tag.hpp>
|
#include <boost/multi_index/detail/do_not_copy_elements_tag.hpp>
|
||||||
@ -45,7 +46,6 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||||
#include <initializer_list>
|
#include <initializer_list>
|
||||||
@ -103,68 +103,63 @@ class hashed_index:
|
|||||||
#pragma parse_mfunc_templ off
|
#pragma parse_mfunc_templ off
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef typename SuperMeta::type super;
|
typedef typename SuperMeta::type super;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef hashed_index_node<
|
typedef hashed_index_node<
|
||||||
typename super::node_type,Category> node_type;
|
typename super::node_type,Category> node_type;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef typename node_type::node_alg node_alg;
|
typedef typename node_type::node_alg node_alg;
|
||||||
typedef typename node_type::impl_type node_impl_type;
|
typedef typename node_type::impl_type node_impl_type;
|
||||||
typedef typename node_impl_type::pointer node_impl_pointer;
|
typedef typename node_impl_type::pointer node_impl_pointer;
|
||||||
typedef typename node_impl_type::base_pointer node_impl_base_pointer;
|
typedef typename node_impl_type::base_pointer node_impl_base_pointer;
|
||||||
typedef bucket_array<
|
typedef bucket_array<
|
||||||
typename super::final_allocator_type> bucket_array_type;
|
typename super::final_allocator_type> bucket_array_type;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/* types */
|
/* types */
|
||||||
|
|
||||||
typedef typename KeyFromValue::result_type key_type;
|
typedef typename KeyFromValue::result_type key_type;
|
||||||
typedef typename node_type::value_type value_type;
|
typedef typename node_type::value_type value_type;
|
||||||
typedef KeyFromValue key_from_value;
|
typedef KeyFromValue key_from_value;
|
||||||
typedef Hash hasher;
|
typedef Hash hasher;
|
||||||
typedef Pred key_equal;
|
typedef Pred key_equal;
|
||||||
typedef typename super::final_allocator_type allocator_type;
|
typedef typename super::final_allocator_type allocator_type;
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
|
||||||
typedef typename allocator_type::pointer pointer;
|
private:
|
||||||
typedef typename allocator_type::const_pointer const_pointer;
|
typedef allocator_traits<allocator_type> alloc_traits;
|
||||||
typedef typename allocator_type::reference reference;
|
|
||||||
typedef typename allocator_type::const_reference const_reference;
|
public:
|
||||||
typedef typename allocator_type::size_type size_type;
|
typedef typename alloc_traits::pointer pointer;
|
||||||
typedef typename allocator_type::difference_type difference_type;
|
typedef typename alloc_traits::const_pointer const_pointer;
|
||||||
#else
|
typedef value_type& reference;
|
||||||
typedef std::allocator_traits<allocator_type> allocator_traits;
|
typedef const value_type& const_reference;
|
||||||
typedef typename allocator_traits::pointer pointer;
|
typedef typename alloc_traits::size_type size_type;
|
||||||
typedef typename allocator_traits::const_pointer const_pointer;
|
typedef typename alloc_traits::difference_type difference_type;
|
||||||
typedef value_type& reference;
|
|
||||||
typedef const value_type& const_reference;
|
|
||||||
typedef typename allocator_traits::size_type size_type;
|
|
||||||
typedef typename allocator_traits::difference_type difference_type;
|
|
||||||
#endif
|
|
||||||
typedef tuple<size_type,
|
typedef tuple<size_type,
|
||||||
key_from_value,hasher,key_equal> ctor_args;
|
key_from_value,hasher,key_equal> ctor_args;
|
||||||
|
|
||||||
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
||||||
typedef safe_mode::safe_iterator<
|
typedef safe_mode::safe_iterator<
|
||||||
hashed_index_iterator<
|
hashed_index_iterator<
|
||||||
node_type,bucket_array_type,
|
node_type,bucket_array_type,
|
||||||
hashed_index_global_iterator_tag>,
|
hashed_index_global_iterator_tag>,
|
||||||
hashed_index> iterator;
|
hashed_index> iterator;
|
||||||
#else
|
#else
|
||||||
typedef hashed_index_iterator<
|
typedef hashed_index_iterator<
|
||||||
node_type,bucket_array_type,
|
node_type,bucket_array_type,
|
||||||
hashed_index_global_iterator_tag> iterator;
|
hashed_index_global_iterator_tag> iterator;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef iterator const_iterator;
|
typedef iterator const_iterator;
|
||||||
|
|
||||||
typedef hashed_index_iterator<
|
typedef hashed_index_iterator<
|
||||||
node_type,bucket_array_type,
|
node_type,bucket_array_type,
|
||||||
hashed_index_local_iterator_tag> local_iterator;
|
hashed_index_local_iterator_tag> local_iterator;
|
||||||
typedef local_iterator const_local_iterator;
|
typedef local_iterator const_local_iterator;
|
||||||
|
|
||||||
typedef TagList tag_list;
|
typedef TagList tag_list;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef typename super::final_node_type final_node_type;
|
typedef typename super::final_node_type final_node_type;
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include <boost/mpl/not.hpp>
|
#include <boost/mpl/not.hpp>
|
||||||
#include <boost/mpl/push_front.hpp>
|
#include <boost/mpl/push_front.hpp>
|
||||||
#include <boost/multi_index/detail/access_specifier.hpp>
|
#include <boost/multi_index/detail/access_specifier.hpp>
|
||||||
|
#include <boost/multi_index/detail/allocator_traits.hpp>
|
||||||
#include <boost/multi_index/detail/do_not_copy_elements_tag.hpp>
|
#include <boost/multi_index/detail/do_not_copy_elements_tag.hpp>
|
||||||
#include <boost/multi_index/detail/index_node_base.hpp>
|
#include <boost/multi_index/detail/index_node_base.hpp>
|
||||||
#include <boost/multi_index/detail/rnd_node_iterator.hpp>
|
#include <boost/multi_index/detail/rnd_node_iterator.hpp>
|
||||||
@ -44,7 +45,6 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||||
#include<initializer_list>
|
#include<initializer_list>
|
||||||
@ -96,59 +96,50 @@ class random_access_index:
|
|||||||
#pragma parse_mfunc_templ off
|
#pragma parse_mfunc_templ off
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef typename SuperMeta::type super;
|
typedef typename SuperMeta::type super;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef random_access_index_node<
|
typedef random_access_index_node<
|
||||||
typename super::node_type> node_type;
|
typename super::node_type> node_type;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef typename node_type::impl_type node_impl_type;
|
typedef typename node_type::impl_type node_impl_type;
|
||||||
typedef random_access_index_ptr_array<
|
typedef random_access_index_ptr_array<
|
||||||
typename super::final_allocator_type> ptr_array;
|
typename super::final_allocator_type> ptr_array;
|
||||||
typedef typename ptr_array::pointer node_impl_ptr_pointer;
|
typedef typename ptr_array::pointer node_impl_ptr_pointer;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/* types */
|
/* types */
|
||||||
|
|
||||||
typedef typename node_type::value_type value_type;
|
typedef typename node_type::value_type value_type;
|
||||||
typedef tuples::null_type ctor_args;
|
typedef tuples::null_type ctor_args;
|
||||||
typedef typename super::final_allocator_type allocator_type;
|
typedef typename super::final_allocator_type allocator_type;
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
typedef value_type& reference;
|
||||||
typedef typename allocator_type::reference reference;
|
typedef const value_type& const_reference;
|
||||||
typedef typename allocator_type::const_reference const_reference;
|
|
||||||
#else
|
|
||||||
typedef value_type& reference;
|
|
||||||
typedef const value_type& const_reference;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
||||||
typedef safe_mode::safe_iterator<
|
typedef safe_mode::safe_iterator<
|
||||||
rnd_node_iterator<node_type>,
|
rnd_node_iterator<node_type>,
|
||||||
random_access_index> iterator;
|
random_access_index> iterator;
|
||||||
#else
|
#else
|
||||||
typedef rnd_node_iterator<node_type> iterator;
|
typedef rnd_node_iterator<node_type> iterator;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef iterator const_iterator;
|
typedef iterator const_iterator;
|
||||||
|
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
private:
|
||||||
typedef typename allocator_type::pointer pointer;
|
typedef allocator_traits<allocator_type> alloc_traits;
|
||||||
typedef typename allocator_type::const_pointer const_pointer;
|
|
||||||
typedef typename allocator_type::size_type size_type;
|
public:
|
||||||
typedef typename allocator_type::difference_type difference_type;
|
typedef typename alloc_traits::pointer pointer;
|
||||||
#else
|
typedef typename alloc_traits::const_pointer const_pointer;
|
||||||
typedef std::allocator_traits<allocator_type> allocator_traits;
|
typedef typename alloc_traits::size_type size_type;
|
||||||
typedef typename allocator_traits::pointer pointer;
|
typedef typename alloc_traits::difference_type difference_type;
|
||||||
typedef typename allocator_traits::const_pointer const_pointer;
|
|
||||||
typedef typename allocator_traits::size_type size_type;
|
|
||||||
typedef typename allocator_traits::difference_type difference_type;
|
|
||||||
#endif
|
|
||||||
typedef typename
|
typedef typename
|
||||||
boost::reverse_iterator<iterator> reverse_iterator;
|
boost::reverse_iterator<iterator> reverse_iterator;
|
||||||
typedef typename
|
typedef typename
|
||||||
boost::reverse_iterator<const_iterator> const_reverse_iterator;
|
boost::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||||
typedef TagList tag_list;
|
typedef TagList tag_list;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef typename super::final_node_type final_node_type;
|
typedef typename super::final_node_type final_node_type;
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include <boost/mpl/not.hpp>
|
#include <boost/mpl/not.hpp>
|
||||||
#include <boost/mpl/push_front.hpp>
|
#include <boost/mpl/push_front.hpp>
|
||||||
#include <boost/multi_index/detail/access_specifier.hpp>
|
#include <boost/multi_index/detail/access_specifier.hpp>
|
||||||
|
#include <boost/multi_index/detail/allocator_traits.hpp>
|
||||||
#include <boost/multi_index/detail/bidir_node_iterator.hpp>
|
#include <boost/multi_index/detail/bidir_node_iterator.hpp>
|
||||||
#include <boost/multi_index/detail/do_not_copy_elements_tag.hpp>
|
#include <boost/multi_index/detail/do_not_copy_elements_tag.hpp>
|
||||||
#include <boost/multi_index/detail/index_node_base.hpp>
|
#include <boost/multi_index/detail/index_node_base.hpp>
|
||||||
@ -41,7 +42,6 @@
|
|||||||
#include <boost/type_traits/is_integral.hpp>
|
#include <boost/type_traits/is_integral.hpp>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||||
#include<initializer_list>
|
#include<initializer_list>
|
||||||
@ -91,56 +91,47 @@ class sequenced_index:
|
|||||||
#pragma parse_mfunc_templ off
|
#pragma parse_mfunc_templ off
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef typename SuperMeta::type super;
|
typedef typename SuperMeta::type super;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef sequenced_index_node<
|
typedef sequenced_index_node<
|
||||||
typename super::node_type> node_type;
|
typename super::node_type> node_type;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef typename node_type::impl_type node_impl_type;
|
typedef typename node_type::impl_type node_impl_type;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/* types */
|
/* types */
|
||||||
|
|
||||||
typedef typename node_type::value_type value_type;
|
typedef typename node_type::value_type value_type;
|
||||||
typedef tuples::null_type ctor_args;
|
typedef tuples::null_type ctor_args;
|
||||||
typedef typename super::final_allocator_type allocator_type;
|
typedef typename super::final_allocator_type allocator_type;
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
typedef value_type& reference;
|
||||||
typedef typename allocator_type::reference reference;
|
typedef const value_type& const_reference;
|
||||||
typedef typename allocator_type::const_reference const_reference;
|
|
||||||
#else
|
|
||||||
typedef value_type& reference;
|
|
||||||
typedef const value_type& const_reference;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
||||||
typedef safe_mode::safe_iterator<
|
typedef safe_mode::safe_iterator<
|
||||||
bidir_node_iterator<node_type>,
|
bidir_node_iterator<node_type>,
|
||||||
sequenced_index> iterator;
|
sequenced_index> iterator;
|
||||||
#else
|
#else
|
||||||
typedef bidir_node_iterator<node_type> iterator;
|
typedef bidir_node_iterator<node_type> iterator;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef iterator const_iterator;
|
typedef iterator const_iterator;
|
||||||
|
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
private:
|
||||||
typedef typename allocator_type::pointer pointer;
|
typedef allocator_traits<allocator_type> alloc_traits;
|
||||||
typedef typename allocator_type::const_pointer const_pointer;
|
|
||||||
typedef typename allocator_type::size_type size_type;
|
public:
|
||||||
typedef typename allocator_type::difference_type difference_type;
|
typedef typename alloc_traits::pointer pointer;
|
||||||
#else
|
typedef typename alloc_traits::const_pointer const_pointer;
|
||||||
typedef std::allocator_traits<allocator_type> allocator_traits;
|
typedef typename alloc_traits::size_type size_type;
|
||||||
typedef typename allocator_traits::pointer pointer;
|
typedef typename alloc_traits::difference_type difference_type;
|
||||||
typedef typename allocator_traits::const_pointer const_pointer;
|
|
||||||
typedef typename allocator_traits::size_type size_type;
|
|
||||||
typedef typename allocator_traits::difference_type difference_type;
|
|
||||||
#endif
|
|
||||||
typedef typename
|
typedef typename
|
||||||
boost::reverse_iterator<iterator> reverse_iterator;
|
boost::reverse_iterator<iterator> reverse_iterator;
|
||||||
typedef typename
|
typedef typename
|
||||||
boost::reverse_iterator<const_iterator> const_reverse_iterator;
|
boost::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||||
typedef TagList tag_list;
|
typedef TagList tag_list;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef typename super::final_node_type final_node_type;
|
typedef typename super::final_node_type final_node_type;
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <memory>
|
|
||||||
#include <boost/core/addressof.hpp>
|
#include <boost/core/addressof.hpp>
|
||||||
#include <boost/detail/allocator_utilities.hpp>
|
#include <boost/detail/allocator_utilities.hpp>
|
||||||
#include <boost/detail/no_exceptions_support.hpp>
|
#include <boost/detail/no_exceptions_support.hpp>
|
||||||
@ -33,6 +32,7 @@
|
|||||||
#include <boost/multi_index_container_fwd.hpp>
|
#include <boost/multi_index_container_fwd.hpp>
|
||||||
#include <boost/multi_index/detail/access_specifier.hpp>
|
#include <boost/multi_index/detail/access_specifier.hpp>
|
||||||
#include <boost/multi_index/detail/adl_swap.hpp>
|
#include <boost/multi_index/detail/adl_swap.hpp>
|
||||||
|
#include <boost/multi_index/detail/allocator_traits.hpp>
|
||||||
#include <boost/multi_index/detail/base_type.hpp>
|
#include <boost/multi_index/detail/base_type.hpp>
|
||||||
#include <boost/multi_index/detail/do_not_copy_elements_tag.hpp>
|
#include <boost/multi_index/detail/do_not_copy_elements_tag.hpp>
|
||||||
#include <boost/multi_index/detail/converter.hpp>
|
#include <boost/multi_index/detail/converter.hpp>
|
||||||
@ -91,19 +91,13 @@ class multi_index_container:
|
|||||||
Value,IndexSpecifierList,Allocator>::type
|
Value,IndexSpecifierList,Allocator>::type
|
||||||
>::type>,
|
>::type>,
|
||||||
BOOST_MULTI_INDEX_PRIVATE_IF_MEMBER_TEMPLATE_FRIENDS detail::header_holder<
|
BOOST_MULTI_INDEX_PRIVATE_IF_MEMBER_TEMPLATE_FRIENDS detail::header_holder<
|
||||||
#ifndef BOOST_NO_CXX11_ALLOCATOR
|
typename detail::allocator_traits<
|
||||||
typename std::allocator_traits<
|
|
||||||
#endif
|
|
||||||
typename boost::detail::allocator::rebind_to<
|
typename boost::detail::allocator::rebind_to<
|
||||||
Allocator,
|
Allocator,
|
||||||
typename detail::multi_index_node_type<
|
typename detail::multi_index_node_type<
|
||||||
Value,IndexSpecifierList,Allocator>::type
|
Value,IndexSpecifierList,Allocator>::type
|
||||||
>::type
|
>::type
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
|
||||||
::pointer,
|
|
||||||
#else
|
|
||||||
>::pointer,
|
>::pointer,
|
||||||
#endif
|
|
||||||
multi_index_container<Value,IndexSpecifierList,Allocator> >,
|
multi_index_container<Value,IndexSpecifierList,Allocator> >,
|
||||||
public detail::multi_index_base_type<
|
public detail::multi_index_base_type<
|
||||||
Value,IndexSpecifierList,Allocator>::type
|
Value,IndexSpecifierList,Allocator>::type
|
||||||
@ -133,18 +127,14 @@ private:
|
|||||||
boost::detail::allocator::rebind_to<
|
boost::detail::allocator::rebind_to<
|
||||||
Allocator,
|
Allocator,
|
||||||
typename super::node_type
|
typename super::node_type
|
||||||
>::type node_allocator;
|
>::type node_allocator;
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
typedef detail::allocator_traits<node_allocator> node_alloc_traits;
|
||||||
typedef typename node_allocator::pointer node_pointer;
|
typedef typename node_alloc_traits::pointer node_pointer;
|
||||||
#else
|
|
||||||
typedef std::allocator_traits<node_allocator> node_allocator_traits;
|
|
||||||
typedef typename node_allocator_traits::pointer node_pointer;
|
|
||||||
#endif
|
|
||||||
typedef ::boost::base_from_member<
|
typedef ::boost::base_from_member<
|
||||||
node_allocator> bfm_allocator;
|
node_allocator> bfm_allocator;
|
||||||
typedef detail::header_holder<
|
typedef detail::header_holder<
|
||||||
node_pointer,
|
node_pointer,
|
||||||
multi_index_container> bfm_header;
|
multi_index_container> bfm_header;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/* All types are inherited from super, a few are explicitly
|
/* All types are inherited from super, a few are explicitly
|
||||||
@ -548,20 +538,12 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
|
|||||||
|
|
||||||
node_type* allocate_node()
|
node_type* allocate_node()
|
||||||
{
|
{
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
return &*node_alloc_traits::allocate(bfm_allocator::member,1);
|
||||||
return &*bfm_allocator::member.allocate(1);
|
|
||||||
#else
|
|
||||||
return &*node_allocator_traits::allocate(bfm_allocator::member,1);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void deallocate_node(node_type* x)
|
void deallocate_node(node_type* x)
|
||||||
{
|
{
|
||||||
#ifdef BOOST_NO_CXX11_ALLOCATOR
|
node_alloc_traits::deallocate(bfm_allocator::member,static_cast<node_pointer>(x),1);
|
||||||
bfm_allocator::member.deallocate(static_cast<node_pointer>(x),1);
|
|
||||||
#else
|
|
||||||
node_allocator_traits::deallocate(bfm_allocator::member,static_cast<node_pointer>(x),1);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool empty_()const
|
bool empty_()const
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* Used in Boost.MultiIndex tests.
|
/* Used in Boost.MultiIndex tests.
|
||||||
*
|
*
|
||||||
* Copyright 2003-2015 Joaquin M Lopez Munoz.
|
* Copyright 2003-2018 Joaquin M Lopez Munoz.
|
||||||
* Distributed under the Boost Software License, Version 1.0.
|
* Distributed under the Boost Software License, Version 1.0.
|
||||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
* http://www.boost.org/LICENSE_1_0.txt)
|
* http://www.boost.org/LICENSE_1_0.txt)
|
||||||
@ -23,7 +23,6 @@
|
|||||||
#include <boost/multi_index/random_access_index.hpp>
|
#include <boost/multi_index/random_access_index.hpp>
|
||||||
#include <boost/multi_index/ranked_index.hpp>
|
#include <boost/multi_index/ranked_index.hpp>
|
||||||
#include <boost/multi_index/sequenced_index.hpp>
|
#include <boost/multi_index/sequenced_index.hpp>
|
||||||
#include <cstddef>
|
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "non_std_allocator.hpp"
|
#include "non_std_allocator.hpp"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user