updated boost on windows

This commit is contained in:
Bassem Girgis
2019-08-13 21:48:48 -05:00
parent 7d77d485fd
commit b40a3bee82
5162 changed files with 473027 additions and 116452 deletions

View File

@@ -0,0 +1,143 @@
/* 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/detail/workaround.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/multi_index/detail/vartempl_support.hpp>
#include <new>
#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 T>
struct rebind_alloc
{
typedef typename super::template rebind_alloc<T> type;
};
template<typename T>
struct rebind_traits
{
typedef typename super::template rebind_traits<T> 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;
/* [const_]void_pointer not provided as boost::pointer_traits's
* rebind_to has been seen to fail with things like
* boost::interprocess::offset_ptr in relatively old environments.
*/
typedef typename Allocator::difference_type difference_type;
typedef typename Allocator::size_type size_type;
template<typename T>
struct rebind_alloc
{
typedef typename Allocator::template rebind<T>::other type;
};
template<typename T>
struct rebind_traits
{
typedef allocator_traits<typename rebind_alloc<T>::type> type;
};
static pointer allocate(Allocator& a,size_type n){return a.allocate(n);}
static pointer allocate(Allocator& a,size_type n,const_pointer p)
/* should've been const_void_pointer p */
{return a.allocate(n,p);}
static void deallocate(Allocator& a,pointer p,size_type n)
{a.deallocate(p,n);}
template<typename T>
static void construct(Allocator&,T* p,const T& x)
{::new (static_cast<void*>(p)) T(x);}
template<typename T>
static void construct(Allocator&,T* p,BOOST_RV_REF(T) x)
{::new (static_cast<void*>(p)) T(boost::move(x));}
template<typename T,BOOST_MULTI_INDEX_TEMPLATE_PARAM_PACK>
static void construct(Allocator&,T* p,BOOST_MULTI_INDEX_FUNCTION_PARAM_PACK)
{
vartempl_placement_new(p,BOOST_MULTI_INDEX_FORWARD_PARAM_PACK);
}
#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
/* MSVC issues spurious warnings about unreferencend formal parameters in
* destroy<T> when T is a class with trivial dtor.
*/
#pragma warning(push)
#pragma warning(disable:4100)
#endif
template<typename T>
static void destroy(Allocator&,T* p){p->~T();}
#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
#pragma warning(pop)
#endif
static size_type max_size(Allocator& a)BOOST_NOEXCEPT{return a.max_size();}
};
#endif
template<typename Allocator,typename T>
struct rebind_alloc_for
{
typedef typename allocator_traits<Allocator>::
template rebind_alloc<T>::type type;
};
} /* namespace multi_index::detail */
} /* namespace multi_index */
} /* namespace boost */
#endif

View File

@@ -1,4 +1,4 @@
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
/* 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)
@@ -15,8 +15,8 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <algorithm>
#include <boost/detail/allocator_utilities.hpp>
#include <boost/multi_index/detail/adl_swap.hpp>
#include <boost/multi_index/detail/allocator_traits.hpp>
#include <boost/noncopyable.hpp>
#include <memory>
@@ -45,18 +45,18 @@ namespace detail{
template<typename T,typename Allocator=std::allocator<T> >
struct auto_space:private noncopyable
{
typedef typename boost::detail::allocator::rebind_to<
Allocator,T
>::type::pointer pointer;
typedef typename rebind_alloc_for<
Allocator,T>
::type allocator;
typedef allocator_traits<allocator> alloc_traits;
typedef typename alloc_traits::pointer pointer;
typedef typename alloc_traits::size_type size_type;
explicit auto_space(const Allocator& al=Allocator(),std::size_t n=1):
al_(al),n_(n),data_(n_?al_.allocate(n_):pointer(0))
explicit auto_space(const Allocator& al=Allocator(),size_type n=1):
al_(al),n_(n),data_(n_?alloc_traits::allocate(al_,n_):pointer(0))
{}
~auto_space()
{
if(n_)al_.deallocate(data_,n_);
}
~auto_space(){if(n_)alloc_traits::deallocate(al_,data_,n_);}
Allocator get_allocator()const{return al_;}
@@ -70,10 +70,9 @@ struct auto_space:private noncopyable
}
private:
typename boost::detail::allocator::rebind_to<
Allocator,T>::type al_;
std::size_t n_;
pointer data_;
allocator al_;
size_type n_;
pointer data_;
};
template<typename T,typename Allocator>

View File

@@ -1,4 +1,4 @@
/* Copyright 2003-2014 Joaquin M Lopez Munoz.
/* 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)
@@ -36,7 +36,7 @@ class bidir_node_iterator:
public bidirectional_iterator_helper<
bidir_node_iterator<Node>,
typename Node::value_type,
std::ptrdiff_t,
typename Node::difference_type,
const typename Node::value_type*,
const typename Node::value_type&>
{

View File

@@ -1,4 +1,4 @@
/* Copyright 2003-2015 Joaquin M Lopez Munoz.
/* 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)
@@ -15,6 +15,7 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <algorithm>
#include <boost/multi_index/detail/allocator_traits.hpp>
#include <boost/multi_index/detail/auto_space.hpp>
#include <boost/multi_index/detail/hash_index_node.hpp>
#include <boost/noncopyable.hpp>
@@ -128,7 +129,7 @@ class bucket_array:bucket_array_base<>
{
typedef bucket_array_base<> super;
typedef hashed_index_base_node_impl<
typename boost::detail::allocator::rebind_to<
typename rebind_alloc_for<
Allocator,
char
>::type
@@ -140,7 +141,7 @@ public:
bucket_array(const Allocator& al,pointer end_,std::size_t size_):
size_index_(super::size_index(size_)),
spc(al,super::sizes[size_index_]+1)
spc(al,static_cast<auto_space_size_type>(super::sizes[size_index_]+1))
{
clear(end_);
}
@@ -173,8 +174,11 @@ public:
}
private:
std::size_t size_index_;
auto_space<base_node_impl_type,Allocator> spc;
typedef auto_space<base_node_impl_type,Allocator> auto_space_type;
typedef typename auto_space_type::size_type auto_space_size_type;
std::size_t size_index_;
auto_space_type spc;
base_pointer buckets()const
{

View File

@@ -1,4 +1,4 @@
/* Copyright 2003-2015 Joaquin M Lopez Munoz.
/* 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)
@@ -15,11 +15,12 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <algorithm>
#include <boost/core/addressof.hpp>
#include <boost/detail/no_exceptions_support.hpp>
#include <boost/multi_index/detail/allocator_traits.hpp>
#include <boost/multi_index/detail/auto_space.hpp>
#include <boost/multi_index/detail/raw_ptr.hpp>
#include <boost/noncopyable.hpp>
#include <cstddef>
#include <functional>
namespace boost{
@@ -57,11 +58,18 @@ struct copy_map_entry
template <typename Node,typename Allocator>
class copy_map:private noncopyable
{
typedef typename rebind_alloc_for<
Allocator,Node
>::type allocator_type;
typedef allocator_traits<allocator_type> alloc_traits;
typedef typename alloc_traits::pointer pointer;
public:
typedef const copy_map_entry<Node>* const_iterator;
typedef const copy_map_entry<Node>* const_iterator;
typedef typename alloc_traits::size_type size_type;
copy_map(
const Allocator& al,std::size_t size,Node* header_org,Node* header_cpy):
const Allocator& al,size_type size,Node* header_org,Node* header_cpy):
al_(al),size_(size),spc(al_,size_),n(0),
header_org_(header_org),header_cpy_(header_cpy),released(false)
{}
@@ -69,8 +77,9 @@ public:
~copy_map()
{
if(!released){
for(std::size_t i=0;i<n;++i){
boost::detail::allocator::destroy(&(spc.data()+i)->second->value());
for(size_type i=0;i<n;++i){
alloc_traits::destroy(
al_,boost::addressof((spc.data()+i)->second->value()));
deallocate((spc.data()+i)->second);
}
}
@@ -82,10 +91,10 @@ public:
void clone(Node* node)
{
(spc.data()+n)->first=node;
(spc.data()+n)->second=raw_ptr<Node*>(al_.allocate(1));
(spc.data()+n)->second=raw_ptr<Node*>(allocate());
BOOST_TRY{
boost::detail::allocator::construct(
&(spc.data()+n)->second->value(),node->value());
alloc_traits::construct(
al_,boost::addressof((spc.data()+n)->second->value()),node->value());
}
BOOST_CATCH(...){
deallocate((spc.data()+n)->second);
@@ -114,22 +123,22 @@ public:
}
private:
typedef typename boost::detail::allocator::rebind_to<
Allocator,Node
>::type allocator_type;
typedef typename allocator_type::pointer allocator_pointer;
allocator_type al_;
size_type size_;
auto_space<copy_map_entry<Node>,Allocator> spc;
size_type n;
Node* header_org_;
Node* header_cpy_;
bool released;
allocator_type al_;
std::size_t size_;
auto_space<copy_map_entry<Node>,Allocator> spc;
std::size_t n;
Node* header_org_;
Node* header_cpy_;
bool released;
pointer allocate()
{
return alloc_traits::allocate(al_,1);
}
void deallocate(Node* node)
{
al_.deallocate(static_cast<allocator_pointer>(node),1);
alloc_traits::deallocate(al_,static_cast<pointer>(node),1);
}
};

View File

@@ -1,4 +1,4 @@
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
/* 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)
@@ -14,7 +14,6 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <cstddef>
#include <iterator>
namespace boost{
@@ -32,7 +31,7 @@ class duplicates_iterator
{
public:
typedef typename Node::value_type value_type;
typedef std::ptrdiff_t difference_type;
typedef typename Node::difference_type difference_type;
typedef const typename Node::value_type* pointer;
typedef const typename Node::value_type& reference;
typedef std::forward_iterator_tag iterator_category;

View File

@@ -1,4 +1,4 @@
/* Copyright 2003-2014 Joaquin M Lopez Munoz.
/* 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)
@@ -39,7 +39,7 @@ class hashed_index_iterator:
public forward_iterator_helper<
hashed_index_iterator<Node,BucketArray,Category>,
typename Node::value_type,
std::ptrdiff_t,
typename Node::difference_type,
const typename Node::value_type*,
const typename Node::value_type&>
{

View File

@@ -1,4 +1,4 @@
/* Copyright 2003-2015 Joaquin M Lopez Munoz.
/* Copyright 2003-2019 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)
@@ -14,7 +14,7 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/detail/allocator_utilities.hpp>
#include <boost/multi_index/detail/allocator_traits.hpp>
#include <boost/multi_index/detail/raw_ptr.hpp>
#include <utility>
@@ -99,24 +99,19 @@ struct hashed_index_node_impl;
template<typename Allocator>
struct hashed_index_base_node_impl
{
typedef typename
boost::detail::allocator::rebind_to<
Allocator,hashed_index_base_node_impl
>::type::pointer base_pointer;
typedef typename
boost::detail::allocator::rebind_to<
typedef typename rebind_alloc_for<
Allocator,hashed_index_base_node_impl
>::type::const_pointer const_base_pointer;
typedef typename
boost::detail::allocator::rebind_to<
Allocator,
hashed_index_node_impl<Allocator>
>::type::pointer pointer;
typedef typename
boost::detail::allocator::rebind_to<
Allocator,
hashed_index_node_impl<Allocator>
>::type::const_pointer const_pointer;
>::type base_allocator;
typedef typename rebind_alloc_for<
Allocator,hashed_index_node_impl<Allocator>
>::type node_allocator;
typedef allocator_traits<base_allocator> base_alloc_traits;
typedef allocator_traits<node_allocator> node_alloc_traits;
typedef typename base_alloc_traits::pointer base_pointer;
typedef typename base_alloc_traits::const_pointer const_base_pointer;
typedef typename node_alloc_traits::pointer pointer;
typedef typename node_alloc_traits::const_pointer const_pointer;
typedef typename node_alloc_traits::difference_type difference_type;
pointer& prior(){return prior_;}
pointer prior()const{return prior_;}
@@ -413,7 +408,7 @@ struct hashed_index_node_alg<Node,hashed_non_unique_tag>
buc->prior()=x;
x->next()->prior()=x;
}
};
}
static void link(pointer x,pointer first,pointer last)
{
@@ -694,17 +689,15 @@ private:
template<typename Super>
struct hashed_index_node_trampoline:
hashed_index_node_impl<
typename boost::detail::allocator::rebind_to<
typename Super::allocator_type,
char
typename rebind_alloc_for<
typename Super::allocator_type,char
>::type
>
{
typedef typename boost::detail::allocator::rebind_to<
typename Super::allocator_type,
char
>::type impl_allocator_type;
typedef hashed_index_node_impl<impl_allocator_type> impl_type;
typedef typename rebind_alloc_for<
typename Super::allocator_type,char
>::type impl_allocator_type;
typedef hashed_index_node_impl<impl_allocator_type> impl_type;
};
template<typename Super,typename Category>
@@ -722,6 +715,7 @@ public:
typedef typename trampoline::const_base_pointer const_impl_base_pointer;
typedef typename trampoline::pointer impl_pointer;
typedef typename trampoline::const_pointer const_impl_pointer;
typedef typename trampoline::difference_type difference_type;
impl_pointer& prior(){return trampoline::prior();}
impl_pointer prior()const{return trampoline::prior();}

View File

@@ -1,4 +1,4 @@
/* Copyright 2003-2014 Joaquin M Lopez Munoz.
/* 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)
@@ -14,12 +14,13 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/detail/allocator_utilities.hpp>
#include <boost/core/addressof.hpp>
#include <boost/detail/no_exceptions_support.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility.hpp>
#include <boost/move/utility_core.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/do_not_copy_elements_tag.hpp>
#include <boost/multi_index/detail/node_type.hpp>
@@ -61,10 +62,8 @@ protected:
typedef multi_index_container<
Value,IndexSpecifierList,Allocator> final_type;
typedef tuples::null_type ctor_args_list;
typedef typename
boost::detail::allocator::rebind_to<
Allocator,
typename Allocator::value_type
typedef typename rebind_alloc_for<
Allocator,typename Allocator::value_type
>::type final_allocator_type;
typedef mpl::vector0<> index_type_list;
typedef mpl::vector0<> iterator_type_list;
@@ -85,6 +84,8 @@ protected:
private:
typedef Value value_type;
typedef allocator_traits<Allocator> alloc_traits;
typedef typename alloc_traits::size_type size_type;
protected:
explicit index_base(const ctor_args_list&,const Allocator&){}
@@ -102,7 +103,7 @@ protected:
{
x=final().allocate_node();
BOOST_TRY{
boost::detail::allocator::construct(&x->value(),v);
final().construct_value(x,v);
}
BOOST_CATCH(...){
final().deallocate_node(x);
@@ -116,14 +117,7 @@ protected:
{
x=final().allocate_node();
BOOST_TRY{
/* This shoud have used a modified, T&&-compatible version of
* boost::detail::allocator::construct, but
* <boost/detail/allocator_utilities.hpp> is too old and venerable to
* mess with; besides, it is a general internal utility and the imperfect
* perfect forwarding emulation of Boost.Move might break other libs.
*/
new (&x->value()) value_type(boost::move(const_cast<value_type&>(v)));
final().construct_value(x,boost::move(const_cast<value_type&>(v)));
}
BOOST_CATCH(...){
final().deallocate_node(x);
@@ -158,12 +152,12 @@ protected:
void erase_(node_type* x)
{
boost::detail::allocator::destroy(&x->value());
final().destroy_value(static_cast<final_node_type*>(x));
}
void delete_node_(node_type* x)
{
boost::detail::allocator::destroy(&x->value());
final().destroy_value(static_cast<final_node_type*>(x));
}
void clear_(){}
@@ -188,6 +182,8 @@ protected:
bool modify_rollback_(node_type*){return true;}
bool check_rollback_(node_type*)const{return true;}
#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
/* serialization */
@@ -211,9 +207,9 @@ protected:
final_node_type* final_header()const{return final().header();}
bool final_empty_()const{return final().empty_();}
std::size_t final_size_()const{return final().size_();}
std::size_t final_max_size_()const{return final().max_size_();}
bool final_empty_()const{return final().empty_();}
size_type final_size_()const{return final().size_();}
size_type final_max_size_()const{return final().max_size_();}
std::pair<final_node_type*,bool> final_insert_(const value_type& x)
{return final().insert_(x);}

View File

@@ -1,4 +1,4 @@
/* Copyright 2003-2015 Joaquin M Lopez Munoz.
/* Copyright 2003-2019 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)
@@ -43,6 +43,7 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <algorithm>
#include <boost/call_traits.hpp>
#include <boost/core/addressof.hpp>
#include <boost/detail/no_exceptions_support.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/foreach_fwd.hpp>
@@ -52,6 +53,7 @@
#include <boost/mpl/if.hpp>
#include <boost/mpl/push_front.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/do_not_copy_elements_tag.hpp>
#include <boost/multi_index/detail/index_node_base.hpp>
@@ -161,8 +163,8 @@ public:
value_type,KeyFromValue,Compare> value_compare;
typedef tuple<key_from_value,key_compare> ctor_args;
typedef typename super::final_allocator_type allocator_type;
typedef typename allocator_type::reference reference;
typedef typename allocator_type::const_reference const_reference;
typedef value_type& reference;
typedef const value_type& const_reference;
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
typedef safe_mode::safe_iterator<
@@ -174,10 +176,14 @@ public:
typedef iterator const_iterator;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef typename allocator_type::pointer pointer;
typedef typename allocator_type::const_pointer const_pointer;
private:
typedef allocator_traits<allocator_type> alloc_traits;
public:
typedef typename alloc_traits::size_type size_type;
typedef typename alloc_traits::difference_type difference_type;
typedef typename alloc_traits::pointer pointer;
typedef typename alloc_traits::const_pointer const_pointer;
typedef typename
boost::reverse_iterator<iterator> reverse_iterator;
typedef typename
@@ -267,12 +273,12 @@ public:
iterator iterator_to(const value_type& x)
{
return make_iterator(node_from_value<node_type>(&x));
return make_iterator(node_from_value<node_type>(boost::addressof(x)));
}
const_iterator iterator_to(const value_type& x)const
{
return make_iterator(node_from_value<node_type>(&x));
return make_iterator(node_from_value<node_type>(boost::addressof(x)));
}
/* capacity */
@@ -514,7 +520,7 @@ public:
size_type count(const CompatibleKey& x,const CompatibleCompare& comp)const
{
std::pair<iterator,iterator> p=equal_range(x,comp);
size_type n=std::distance(p.first,p.second);
size_type n=static_cast<size_type>(std::distance(p.first,p.second));
return n;
}
@@ -911,6 +917,11 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
BOOST_CATCH_END
}
bool check_rollback_(node_type* x)const
{
return in_place(x->value(),x,Category())&&super::check_rollback_(x);
}
#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
/* serialization */
@@ -1153,7 +1164,7 @@ private:
this->final_delete_node_(static_cast<final_node_type*>(x));
}
bool in_place(value_param_type v,node_type* x,ordered_unique_tag)
bool in_place(value_param_type v,node_type* x,ordered_unique_tag)const
{
node_type* y;
if(x!=leftmost()){
@@ -1167,7 +1178,7 @@ private:
return y==header()||comp_(key(v),key(y->value()));
}
bool in_place(value_param_type v,node_type* x,ordered_non_unique_tag)
bool in_place(value_param_type v,node_type* x,ordered_non_unique_tag)const
{
node_type* y;
if(x!=leftmost()){
@@ -1416,10 +1427,10 @@ protected:
const ctor_args_list& args_list,const allocator_type& al):
super(args_list,al){}
ordered_index(const ordered_index& x):super(x){};
ordered_index(const ordered_index& x):super(x){}
ordered_index(const ordered_index& x,do_not_copy_elements_tag):
super(x,do_not_copy_elements_tag()){};
super(x,do_not_copy_elements_tag()){}
};
/* comparison */

View File

@@ -1,4 +1,4 @@
/* Copyright 2003-2015 Joaquin M Lopez Munoz.
/* Copyright 2003-2019 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)
@@ -42,7 +42,7 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <cstddef>
#include <boost/detail/allocator_utilities.hpp>
#include <boost/multi_index/detail/allocator_traits.hpp>
#include <boost/multi_index/detail/raw_ptr.hpp>
#if !defined(BOOST_MULTI_INDEX_DISABLE_COMPRESSED_ORDERED_INDEX_NODES)
@@ -67,21 +67,32 @@ enum ordered_index_side{to_left=false,to_right=true};
template<typename AugmentPolicy,typename Allocator>
struct ordered_index_node_impl; /* fwd decl. */
template<typename AugmentPolicy,typename Allocator>
struct ordered_index_node_traits
{
typedef typename rebind_alloc_for<
Allocator,
ordered_index_node_impl<AugmentPolicy,Allocator>
>::type allocator;
typedef allocator_traits<allocator> alloc_traits;
typedef typename alloc_traits::pointer pointer;
typedef typename alloc_traits::const_pointer const_pointer;
typedef typename alloc_traits::difference_type difference_type;
typedef typename alloc_traits::size_type size_type;
};
template<typename AugmentPolicy,typename Allocator>
struct ordered_index_node_std_base
{
typedef typename
boost::detail::allocator::rebind_to<
Allocator,
ordered_index_node_impl<AugmentPolicy,Allocator>
>::type::pointer pointer;
typedef typename
boost::detail::allocator::rebind_to<
Allocator,
ordered_index_node_impl<AugmentPolicy,Allocator>
>::type::const_pointer const_pointer;
typedef ordered_index_color& color_ref;
typedef pointer& parent_ref;
typedef ordered_index_node_traits<
AugmentPolicy,Allocator> node_traits;
typedef typename node_traits::allocator node_allocator;
typedef typename node_traits::pointer pointer;
typedef typename node_traits::const_pointer const_pointer;
typedef typename node_traits::difference_type difference_type;
typedef typename node_traits::size_type size_type;
typedef ordered_index_color& color_ref;
typedef pointer& parent_ref;
ordered_index_color& color(){return color_;}
ordered_index_color color()const{return color_;}
@@ -120,14 +131,19 @@ private:
template<typename AugmentPolicy,typename Allocator>
struct ordered_index_node_compressed_base
{
typedef ordered_index_node_traits<
AugmentPolicy,Allocator> node_traits;
typedef ordered_index_node_impl<
AugmentPolicy,Allocator>* pointer;
AugmentPolicy,Allocator>* pointer;
typedef const ordered_index_node_impl<
AugmentPolicy,Allocator>* const_pointer;
AugmentPolicy,Allocator>* const_pointer;
typedef typename node_traits::difference_type difference_type;
typedef typename node_traits::size_type size_type;
struct color_ref
{
color_ref(uintptr_type* r_):r(r_){}
color_ref(const color_ref& x):r(x.r){}
operator ordered_index_color()const
{
@@ -153,6 +169,7 @@ struct ordered_index_node_compressed_base
struct parent_ref
{
parent_ref(uintptr_type* r_):r(r_){}
parent_ref(const parent_ref& x):r(x.r){}
operator pointer()const
{
@@ -217,10 +234,7 @@ struct ordered_index_node_impl_base:
ordered_index_node_compressed_base<AugmentPolicy,Allocator>
>::value%2)||
!(is_same<
typename boost::detail::allocator::rebind_to<
Allocator,
ordered_index_node_impl<AugmentPolicy,Allocator>
>::type::pointer,
typename ordered_index_node_traits<AugmentPolicy,Allocator>::pointer,
ordered_index_node_impl<AugmentPolicy,Allocator>*>::value),
ordered_index_node_std_base<AugmentPolicy,Allocator>,
ordered_index_node_compressed_base<AugmentPolicy,Allocator>
@@ -566,7 +580,7 @@ template<typename AugmentPolicy,typename Super>
struct ordered_index_node_trampoline:
ordered_index_node_impl<
AugmentPolicy,
typename boost::detail::allocator::rebind_to<
typename rebind_alloc_for<
typename Super::allocator_type,
char
>::type
@@ -574,7 +588,7 @@ struct ordered_index_node_trampoline:
{
typedef ordered_index_node_impl<
AugmentPolicy,
typename boost::detail::allocator::rebind_to<
typename rebind_alloc_for<
typename Super::allocator_type,
char
>::type
@@ -589,11 +603,13 @@ private:
typedef ordered_index_node_trampoline<AugmentPolicy,Super> trampoline;
public:
typedef typename trampoline::impl_type impl_type;
typedef typename trampoline::color_ref impl_color_ref;
typedef typename trampoline::parent_ref impl_parent_ref;
typedef typename trampoline::pointer impl_pointer;
typedef typename trampoline::const_pointer const_impl_pointer;
typedef typename trampoline::impl_type impl_type;
typedef typename trampoline::color_ref impl_color_ref;
typedef typename trampoline::parent_ref impl_parent_ref;
typedef typename trampoline::pointer impl_pointer;
typedef typename trampoline::const_pointer const_impl_pointer;
typedef typename trampoline::difference_type difference_type;
typedef typename trampoline::size_type size_type;
impl_color_ref color(){return trampoline::color();}
ordered_index_color color()const{return trampoline::color();}

View File

@@ -1,4 +1,4 @@
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
/* 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)
@@ -15,11 +15,10 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <algorithm>
#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/rnd_index_ptr_array.hpp>
#include <boost/noncopyable.hpp>
#include <cstddef>
namespace boost{
@@ -45,7 +44,7 @@ class random_access_index_loader_base:private noncopyable
{
protected:
typedef random_access_index_node_impl<
typename boost::detail::allocator::rebind_to<
typename rebind_alloc_for<
Allocator,
char
>::type
@@ -68,9 +67,9 @@ protected:
node_impl_pointer n=header;
next(n)=n;
for(std::size_t i=ptrs.size();i--;){
for(size_type i=ptrs.size();i--;){
n=prev(n);
std::size_t d=position(n);
size_type d=position(n);
if(d!=i){
node_impl_pointer m=prev(next_at(i));
std::swap(m->up(),n->up());
@@ -94,6 +93,9 @@ protected:
}
private:
typedef allocator_traits<Allocator> alloc_traits;
typedef typename alloc_traits::size_type size_type;
void preprocess()
{
if(!preprocessed){
@@ -112,17 +114,17 @@ private:
}
}
std::size_t position(node_impl_pointer x)const
size_type position(node_impl_pointer x)const
{
return (std::size_t)(x->up()-ptrs.begin());
return (size_type)(x->up()-ptrs.begin());
}
node_impl_pointer& next_at(std::size_t n)const
node_impl_pointer& next_at(size_type n)const
{
return *ptrs.at(n);
}
node_impl_pointer& prev_at(std::size_t n)const
node_impl_pointer& prev_at(size_type n)const
{
return *(prev_spc.data()+n);
}

View File

@@ -1,4 +1,4 @@
/* Copyright 2003-2015 Joaquin M Lopez Munoz.
/* 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)
@@ -15,8 +15,8 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <algorithm>
#include <boost/detail/allocator_utilities.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 <cstddef>
#include <functional>
@@ -30,18 +30,18 @@ namespace detail{
template<typename Allocator>
struct random_access_index_node_impl
{
typedef typename
boost::detail::allocator::rebind_to<
typedef typename rebind_alloc_for<
Allocator,random_access_index_node_impl
>::type::pointer pointer;
typedef typename
boost::detail::allocator::rebind_to<
Allocator,random_access_index_node_impl
>::type::const_pointer const_pointer;
typedef typename
boost::detail::allocator::rebind_to<
>::type node_allocator;
typedef allocator_traits<node_allocator> node_alloc_traits;
typedef typename node_alloc_traits::pointer pointer;
typedef typename node_alloc_traits::const_pointer const_pointer;
typedef typename node_alloc_traits::difference_type difference_type;
typedef typename rebind_alloc_for<
Allocator,pointer
>::type::pointer ptr_pointer;
>::type ptr_allocator;
typedef allocator_traits<ptr_allocator> ptr_alloc_traits;
typedef typename ptr_alloc_traits::pointer ptr_pointer;
ptr_pointer& up(){return up_;}
ptr_pointer up()const{return up_;}
@@ -58,14 +58,14 @@ struct random_access_index_node_impl
x=*(x->up()-1);
}
static void advance(pointer& x,std::ptrdiff_t n)
static void advance(pointer& x,difference_type n)
{
x=*(x->up()+n);
}
static std::ptrdiff_t distance(pointer x,pointer y)
static difference_type distance(pointer x,pointer y)
{
return y->up()-x->up();
return static_cast<difference_type>(y->up()-x->up());
}
/* algorithmic stuff */
@@ -176,14 +176,14 @@ private:
template<typename Super>
struct random_access_index_node_trampoline:
random_access_index_node_impl<
typename boost::detail::allocator::rebind_to<
typename rebind_alloc_for<
typename Super::allocator_type,
char
>::type
>
{
typedef random_access_index_node_impl<
typename boost::detail::allocator::rebind_to<
typename rebind_alloc_for<
typename Super::allocator_type,
char
>::type
@@ -198,10 +198,11 @@ private:
typedef random_access_index_node_trampoline<Super> trampoline;
public:
typedef typename trampoline::impl_type impl_type;
typedef typename trampoline::pointer impl_pointer;
typedef typename trampoline::const_pointer const_impl_pointer;
typedef typename trampoline::ptr_pointer impl_ptr_pointer;
typedef typename trampoline::impl_type impl_type;
typedef typename trampoline::pointer impl_pointer;
typedef typename trampoline::const_pointer const_impl_pointer;
typedef typename trampoline::difference_type difference_type;
typedef typename trampoline::ptr_pointer impl_ptr_pointer;
impl_ptr_pointer& up(){return trampoline::up();}
impl_ptr_pointer up()const{return trampoline::up();}
@@ -250,14 +251,14 @@ public:
x=from_impl(xi);
}
static void advance(random_access_index_node*& x,std::ptrdiff_t n)
static void advance(random_access_index_node*& x,difference_type n)
{
impl_pointer xi=x->impl();
trampoline::advance(xi,n);
x=from_impl(xi);
}
static std::ptrdiff_t distance(
static difference_type distance(
random_access_index_node* x,random_access_index_node* y)
{
return trampoline::distance(x->impl(),y->impl());

View File

@@ -1,4 +1,4 @@
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
/* 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)
@@ -15,11 +15,10 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <algorithm>
#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/rnd_index_node.hpp>
#include <boost/noncopyable.hpp>
#include <cstddef>
namespace boost{
@@ -33,20 +32,23 @@ template<typename Allocator>
class random_access_index_ptr_array:private noncopyable
{
typedef random_access_index_node_impl<
typename boost::detail::allocator::rebind_to<
typename rebind_alloc_for<
Allocator,
char
>::type
> node_impl_type;
> node_impl_type;
public:
typedef typename node_impl_type::pointer value_type;
typedef typename boost::detail::allocator::rebind_to<
typedef typename node_impl_type::pointer value_type;
typedef typename rebind_alloc_for<
Allocator,value_type
>::type::pointer pointer;
>::type value_allocator;
typedef allocator_traits<value_allocator> alloc_traits;
typedef typename alloc_traits::pointer pointer;
typedef typename alloc_traits::size_type size_type;
random_access_index_ptr_array(
const Allocator& al,value_type end_,std::size_t sz):
const Allocator& al,value_type end_,size_type sz):
size_(sz),
capacity_(sz),
spc(al,capacity_+1)
@@ -55,8 +57,8 @@ public:
end_->up()=end();
}
std::size_t size()const{return size_;}
std::size_t capacity()const{return capacity_;}
size_type size()const{return size_;}
size_type capacity()const{return capacity_;}
void room_for_one()
{
@@ -65,7 +67,7 @@ public:
}
}
void reserve(std::size_t c)
void reserve(size_type c)
{
if(c>capacity_)set_capacity(c);
}
@@ -77,7 +79,7 @@ public:
pointer begin()const{return ptrs();}
pointer end()const{return ptrs()+size_;}
pointer at(std::size_t n)const{return ptrs()+n;}
pointer at(size_type n)const{return ptrs()+n;}
void push_back(value_type x)
{
@@ -109,8 +111,8 @@ public:
}
private:
std::size_t size_;
std::size_t capacity_;
size_type size_;
size_type capacity_;
auto_space<value_type,Allocator> spc;
pointer ptrs()const
@@ -118,7 +120,7 @@ private:
return spc.data();
}
void set_capacity(std::size_t c)
void set_capacity(size_type c)
{
auto_space<value_type,Allocator> spc1(spc.get_allocator(),c+1);
node_impl_type::transfer(begin(),end()+1,spc1.data());

View File

@@ -1,4 +1,4 @@
/* Copyright 2003-2014 Joaquin M Lopez Munoz.
/* 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)
@@ -34,7 +34,7 @@ class rnd_node_iterator:
public random_access_iterator_helper<
rnd_node_iterator<Node>,
typename Node::value_type,
std::ptrdiff_t,
typename Node::difference_type,
const typename Node::value_type*,
const typename Node::value_type&>
{
@@ -60,13 +60,13 @@ public:
return *this;
}
rnd_node_iterator& operator+=(std::ptrdiff_t n)
rnd_node_iterator& operator+=(typename Node::difference_type n)
{
Node::advance(node,n);
return *this;
}
rnd_node_iterator& operator-=(std::ptrdiff_t n)
rnd_node_iterator& operator-=(typename Node::difference_type n)
{
Node::advance(node,-n);
return *this;
@@ -124,7 +124,7 @@ bool operator<(
}
template<typename Node>
std::ptrdiff_t operator-(
typename Node::difference_type operator-(
const rnd_node_iterator<Node>& x,
const rnd_node_iterator<Node>& y)
{

View File

@@ -1,4 +1,4 @@
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
/* 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)
@@ -14,9 +14,9 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/core/pointer_traits.hpp>
#include <boost/mpl/and.hpp>
#include <boost/multi_index/detail/promotes_arg.hpp>
#include <cstddef>
#include <utility>
namespace boost{
@@ -30,19 +30,30 @@ namespace detail{
*/
template<typename Pointer>
inline std::size_t ranked_node_size(Pointer x)
struct ranked_node_size_type
{
typedef typename boost::pointer_traits<Pointer>::
element_type::size_type type;
};
template<typename Pointer>
inline typename ranked_node_size_type<Pointer>::type
ranked_node_size(Pointer x)
{
return x!=Pointer(0)?x->size:0;
}
template<typename Pointer>
inline Pointer ranked_index_nth(std::size_t n,Pointer end_)
inline Pointer ranked_index_nth(
BOOST_DEDUCED_TYPENAME ranked_node_size_type<Pointer>::type n,Pointer end_)
{
typedef typename ranked_node_size_type<Pointer>::type size_type;
Pointer top=end_->parent();
if(top==Pointer(0)||n>=top->size)return end_;
for(;;){
std::size_t s=ranked_node_size(top->left());
size_type s=ranked_node_size(top->left());
if(n==s)return top;
if(n<s)top=top->left();
else{
@@ -53,13 +64,16 @@ inline Pointer ranked_index_nth(std::size_t n,Pointer end_)
}
template<typename Pointer>
inline std::size_t ranked_index_rank(Pointer x,Pointer end_)
inline typename ranked_node_size_type<Pointer>::type
ranked_index_rank(Pointer x,Pointer end_)
{
typedef typename ranked_node_size_type<Pointer>::type size_type;
Pointer top=end_->parent();
if(top==Pointer(0))return 0;
if(x==end_)return top->size;
std::size_t s=ranked_node_size(x->left());
size_type s=ranked_node_size(x->left());
while(x!=top){
Pointer z=x->parent();
if(x==z->right()){
@@ -74,7 +88,7 @@ template<
typename Node,typename KeyFromValue,
typename CompatibleKey,typename CompatibleCompare
>
inline std::size_t ranked_index_find_rank(
inline typename Node::size_type ranked_index_find_rank(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp)
{
@@ -91,7 +105,7 @@ template<
typename Node,typename KeyFromValue,
typename CompatibleCompare
>
inline std::size_t ranked_index_find_rank(
inline typename Node::size_type ranked_index_find_rank(
Node* top,Node* y,const KeyFromValue& key,
const BOOST_DEDUCED_TYPENAME KeyFromValue::result_type& x,
const CompatibleCompare& comp,mpl::true_)
@@ -103,15 +117,17 @@ template<
typename Node,typename KeyFromValue,
typename CompatibleKey,typename CompatibleCompare
>
inline std::size_t ranked_index_find_rank(
inline typename Node::size_type ranked_index_find_rank(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp,mpl::false_)
{
typedef typename Node::size_type size_type;
if(!top)return 0;
std::size_t s=top->impl()->size,
s0=s;
Node* y0=y;
size_type s=top->impl()->size,
s0=s;
Node* y0=y;
do{
if(!comp(key(top->value()),x)){
@@ -129,7 +145,7 @@ template<
typename Node,typename KeyFromValue,
typename CompatibleKey,typename CompatibleCompare
>
inline std::size_t ranked_index_lower_bound_rank(
inline typename Node::size_type ranked_index_lower_bound_rank(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp)
{
@@ -144,7 +160,7 @@ template<
typename Node,typename KeyFromValue,
typename CompatibleCompare
>
inline std::size_t ranked_index_lower_bound_rank(
inline typename Node::size_type ranked_index_lower_bound_rank(
Node* top,Node* y,const KeyFromValue& key,
const BOOST_DEDUCED_TYPENAME KeyFromValue::result_type& x,
const CompatibleCompare& comp,mpl::true_)
@@ -156,13 +172,15 @@ template<
typename Node,typename KeyFromValue,
typename CompatibleKey,typename CompatibleCompare
>
inline std::size_t ranked_index_lower_bound_rank(
inline typename Node::size_type ranked_index_lower_bound_rank(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp,mpl::false_)
{
typedef typename Node::size_type size_type;
if(!top)return 0;
std::size_t s=top->impl()->size;
size_type s=top->impl()->size;
do{
if(!comp(key(top->value()),x)){
@@ -180,7 +198,7 @@ template<
typename Node,typename KeyFromValue,
typename CompatibleKey,typename CompatibleCompare
>
inline std::size_t ranked_index_upper_bound_rank(
inline typename Node::size_type ranked_index_upper_bound_rank(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp)
{
@@ -195,7 +213,7 @@ template<
typename Node,typename KeyFromValue,
typename CompatibleCompare
>
inline std::size_t ranked_index_upper_bound_rank(
inline typename Node::size_type ranked_index_upper_bound_rank(
Node* top,Node* y,const KeyFromValue& key,
const BOOST_DEDUCED_TYPENAME KeyFromValue::result_type& x,
const CompatibleCompare& comp,mpl::true_)
@@ -207,13 +225,15 @@ template<
typename Node,typename KeyFromValue,
typename CompatibleKey,typename CompatibleCompare
>
inline std::size_t ranked_index_upper_bound_rank(
inline typename Node::size_type ranked_index_upper_bound_rank(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp,mpl::false_)
{
typedef typename Node::size_type size_type;
if(!top)return 0;
std::size_t s=top->impl()->size;
size_type s=top->impl()->size;
do{
if(comp(x,key(top->value()))){
@@ -231,7 +251,8 @@ template<
typename Node,typename KeyFromValue,
typename CompatibleKey,typename CompatibleCompare
>
inline std::pair<std::size_t,std::size_t> ranked_index_equal_range_rank(
inline std::pair<typename Node::size_type,typename Node::size_type>
ranked_index_equal_range_rank(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp)
{
@@ -248,7 +269,8 @@ template<
typename Node,typename KeyFromValue,
typename CompatibleCompare
>
inline std::pair<std::size_t,std::size_t> ranked_index_equal_range_rank(
inline std::pair<typename Node::size_type,typename Node::size_type>
ranked_index_equal_range_rank(
Node* top,Node* y,const KeyFromValue& key,
const BOOST_DEDUCED_TYPENAME KeyFromValue::result_type& x,
const CompatibleCompare& comp,mpl::true_)
@@ -260,13 +282,16 @@ template<
typename Node,typename KeyFromValue,
typename CompatibleKey,typename CompatibleCompare
>
inline std::pair<std::size_t,std::size_t> ranked_index_equal_range_rank(
inline std::pair<typename Node::size_type,typename Node::size_type>
ranked_index_equal_range_rank(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp,mpl::false_)
{
if(!top)return std::pair<std::size_t,std::size_t>(0,0);
typedef typename Node::size_type size_type;
std::size_t s=top->impl()->size;
if(!top)return std::pair<size_type,size_type>(0,0);
size_type s=top->impl()->size;
do{
if(comp(key(top->value()),x)){
@@ -278,7 +303,7 @@ inline std::pair<std::size_t,std::size_t> ranked_index_equal_range_rank(
top=Node::from_impl(top->left());
}
else{
return std::pair<std::size_t,std::size_t>(
return std::pair<size_type,size_type>(
s-top->impl()->size+
ranked_index_lower_bound_rank(
Node::from_impl(top->left()),top,key,x,comp,mpl::false_()),
@@ -288,7 +313,7 @@ inline std::pair<std::size_t,std::size_t> ranked_index_equal_range_rank(
}
}while(top);
return std::pair<std::size_t,std::size_t>(s,s);
return std::pair<size_type,size_type>(s,s);
}
} /* namespace multi_index::detail */

View File

@@ -1,4 +1,4 @@
/* Copyright 2003-2015 Joaquin M Lopez Munoz.
/* Copyright 2003-2019 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)
@@ -15,7 +15,7 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <algorithm>
#include <boost/detail/allocator_utilities.hpp>
#include <boost/multi_index/detail/allocator_traits.hpp>
#include <boost/multi_index/detail/raw_ptr.hpp>
namespace boost{
@@ -29,14 +29,13 @@ namespace detail{
template<typename Allocator>
struct sequenced_index_node_impl
{
typedef typename
boost::detail::allocator::rebind_to<
typedef typename rebind_alloc_for<
Allocator,sequenced_index_node_impl
>::type::pointer pointer;
typedef typename
boost::detail::allocator::rebind_to<
Allocator,sequenced_index_node_impl
>::type::const_pointer const_pointer;
>::type node_allocator;
typedef allocator_traits<node_allocator> alloc_traits;
typedef typename alloc_traits::pointer pointer;
typedef typename alloc_traits::const_pointer const_pointer;
typedef typename alloc_traits::difference_type difference_type;
pointer& prior(){return prior_;}
pointer prior()const{return prior_;}
@@ -55,7 +54,7 @@ struct sequenced_index_node_impl
x->prior()=header->prior();
x->next()=header;
x->prior()->next()=x->next()->prior()=x;
};
}
static void unlink(pointer x)
{
@@ -133,14 +132,14 @@ private:
template<typename Super>
struct sequenced_index_node_trampoline:
sequenced_index_node_impl<
typename boost::detail::allocator::rebind_to<
typename rebind_alloc_for<
typename Super::allocator_type,
char
>::type
>
{
typedef sequenced_index_node_impl<
typename boost::detail::allocator::rebind_to<
typename rebind_alloc_for<
typename Super::allocator_type,
char
>::type
@@ -154,9 +153,10 @@ private:
typedef sequenced_index_node_trampoline<Super> trampoline;
public:
typedef typename trampoline::impl_type impl_type;
typedef typename trampoline::pointer impl_pointer;
typedef typename trampoline::const_pointer const_impl_pointer;
typedef typename trampoline::impl_type impl_type;
typedef typename trampoline::pointer impl_pointer;
typedef typename trampoline::const_pointer const_impl_pointer;
typedef typename trampoline::difference_type difference_type;
impl_pointer& prior(){return trampoline::prior();}
impl_pointer prior()const{return trampoline::prior();}