mirror of
https://github.com/boostorg/container.git
synced 2025-07-31 13:07:17 +02:00
Sync from upstream.
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -118,3 +118,5 @@
|
||||
/proj/vs/vector_test.vcxproj.user
|
||||
/doc/html
|
||||
/doc/autodoc.xml
|
||||
/proj/vs/deque_test.vcxproj
|
||||
/proj/vs/stable_vector_test.vcxproj
|
||||
|
@@ -33,7 +33,8 @@
|
||||
#include <boost/container/detail/type_traits.hpp>
|
||||
#include <boost/move/adl_move_swap.hpp> //adl_move_swap
|
||||
|
||||
#include <boost/move/detail/force_ptr.hpp> //adl_move_swap
|
||||
#include <boost/move/detail/launder.hpp> //
|
||||
#include <boost/move/detail/force_ptr.hpp>
|
||||
|
||||
|
||||
#include "varray_util.hpp"
|
||||
@@ -1071,10 +1072,10 @@ public:
|
||||
|
||||
typename aligned_storage
|
||||
<sizeof(value_type), alignment_of<value_type>::value>::type temp_storage;
|
||||
value_type * val_p = static_cast<value_type*>(static_cast<void*>(&temp_storage));
|
||||
value_type * val_p = move_detail::force_ptr<value_type*>(&temp_storage);
|
||||
sv::construct(dti(), val_p, ::boost::forward<Args>(args)...); // may throw
|
||||
sv::scoped_destructor<value_type> d(val_p);
|
||||
sv::assign(position, ::boost::move(*val_p)); // may throw
|
||||
sv::assign(position, ::boost::move(*move_detail::launder(val_p))); // may throw
|
||||
}
|
||||
|
||||
return position;
|
||||
@@ -1114,10 +1115,10 @@ public:
|
||||
sv::move_backward(position, this->end() - 2, this->end() - 1);/*may throw*/\
|
||||
typename aligned_storage\
|
||||
<sizeof(value_type), alignment_of<value_type>::value>::type temp_storage;\
|
||||
value_type * val_p = static_cast<value_type*>(static_cast<void*>(&temp_storage));\
|
||||
value_type * val_p = move_detail::force_ptr<value_type*>(&temp_storage);\
|
||||
sv::construct(dti(), val_p BOOST_MOVE_I##N BOOST_MOVE_FWD##N ); /*may throw*/\
|
||||
sv::scoped_destructor<value_type> d(val_p);\
|
||||
sv::assign(position, ::boost::move(*val_p));/*may throw*/\
|
||||
sv::assign(position, ::boost::move(*move_detail::launder(val_p)));/*may throw*/\
|
||||
}\
|
||||
return position;\
|
||||
}\
|
||||
@@ -1582,7 +1583,7 @@ private:
|
||||
storage_type;
|
||||
|
||||
storage_type temp_storage;
|
||||
value_type * temp_ptr = static_cast<value_type*>(static_cast<void*>(&temp_storage));
|
||||
value_type * temp_ptr = move_detail::force_ptr<value_type*>(&temp_storage);
|
||||
|
||||
::memcpy(temp_ptr, this->data(), sizeof(Value) * this->size());
|
||||
::memcpy(this->data(), other.data(), sizeof(Value) * other.size());
|
||||
@@ -1626,7 +1627,7 @@ private:
|
||||
sizeof(value_type),
|
||||
alignment_of<value_type>::value
|
||||
>::type temp_storage;
|
||||
value_type * temp_ptr = static_cast<value_type*>(static_cast<void*>(&temp_storage));
|
||||
value_type * temp_ptr = move_detail::force_ptr<value_type*>(&temp_storage);
|
||||
::memcpy(temp_ptr, (addressof)(*first_sm), sizeof(value_type));
|
||||
::memcpy((addressof)(*first_sm), (addressof)(*first_la), sizeof(value_type));
|
||||
::memcpy((addressof)(*first_la), temp_ptr, sizeof(value_type));
|
||||
|
@@ -485,13 +485,13 @@ To avoid unbounded memory waste, Boost.Container's `devector` uses a different s
|
||||
|
||||
* If elements are inserted near one extreme and the free space on that extreme is exhausted, all existing elements
|
||||
are relocated (moved) to the center of the internal memory buffer. This makes room in the exhausted extreme
|
||||
to insert more elements whihout allocating a new buffer.
|
||||
to insert more elements without allocating a new buffer.
|
||||
|
||||
* Potentially, the maximum number of possible relocations (movements) reusing the memory buffer are Olog(N),
|
||||
but that would lead non-amortized constant-time insertion at the extremes. In consequence, the number of
|
||||
relocations must be limited ('relocation limit') and a reallocation (allocation of a new memory buffer) will be
|
||||
performed if the load-factor of the container defined as (size()/length_of_buffer) surpasses the relocation limit (see
|
||||
Lars Greger Nordland Hagen's [href http://larshagencpp.github.io/blog/2016/05/22/devector"Double-ended vector - is it useful?"]
|
||||
Lars Greger Nordland Hagen's [@http://larshagencpp.github.io/blog/2016/05/22/devector "Double-ended vector - is it useful?"]
|
||||
article for more details.
|
||||
|
||||
* This approach offers a reasonable balance between a reasonable memory overhead and performance.
|
||||
@@ -505,14 +505,14 @@ However, this strategy has also some downsides:
|
||||
the number of insertions to perform before a reallocation is performed. Depending on which extreme a insertion
|
||||
takes place, a reallocation might occur or not (maybe there is free capacity at that extreme)
|
||||
|
||||
* Instead of removing the `capacity()` member or renaming it to "minimum_capacity()", the definition has been changed
|
||||
* Instead of removing the `capacity()` member or renaming it to "`minimum_capacity()`", the definition has been changed
|
||||
to tell the *minimum* number of elements that can be inserted without reallocating. This allows the typical pattern
|
||||
where:
|
||||
* If `reserve(n)` is called, `capacity() >= n`
|
||||
* If `capacity() == n` it is guaranteed that if `size() <= n` no reallocation will occur.
|
||||
|
||||
* However the usual container invariant where `size() <= capacity()` does not hold. `size()` can be bigger than
|
||||
`capacity()` because elements can be always inserted at a extreme with free capacity without reallocation.
|
||||
`capacity()` because elements can be always inserted at an extreme with free capacity without reallocation.
|
||||
|
||||
|
||||
[endsect]
|
||||
|
@@ -39,6 +39,7 @@
|
||||
|
||||
#include <boost/move/utility_core.hpp>
|
||||
#include <boost/move/detail/force_ptr.hpp>
|
||||
#include <boost/move/detail/launder.hpp>
|
||||
// other
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
@@ -138,8 +139,8 @@ struct insert_value_initialized_n_proxy
|
||||
while (n){
|
||||
--n;
|
||||
storage_t v;
|
||||
alloc_traits::construct(a, move_detail::force_ptr<value_type *>(&v));
|
||||
value_type *vp = move_detail::force_ptr<value_type *>(&v);
|
||||
alloc_traits::construct(a, (value_type*)&v);
|
||||
value_type *vp = move_detail::launder_cast<value_type *>(&v);
|
||||
value_destructor<Allocator> on_exit(a, *vp); (void)on_exit;
|
||||
*p = ::boost::move(*vp);
|
||||
++p;
|
||||
@@ -165,8 +166,8 @@ struct insert_default_initialized_n_proxy
|
||||
while (n){
|
||||
--n;
|
||||
typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;
|
||||
alloc_traits::construct(a, move_detail::force_ptr<value_type *>(&v), default_init);
|
||||
value_type *vp = move_detail::force_ptr<value_type *>(&v);
|
||||
alloc_traits::construct(a, (value_type*)&v, default_init);
|
||||
value_type *vp = move_detail::launder_cast<value_type *>(&v);
|
||||
value_destructor<Allocator> on_exit(a, *vp); (void)on_exit;
|
||||
*p = ::boost::move(*vp);
|
||||
++p;
|
||||
@@ -312,8 +313,8 @@ struct insert_emplace_proxy
|
||||
{
|
||||
BOOST_ASSERT(n ==1); (void)n;
|
||||
typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;
|
||||
alloc_traits::construct(a, move_detail::force_ptr<value_type *>(&v), ::boost::forward<Args>(get<IdxPack>(this->args_))...);
|
||||
value_type *vp = move_detail::force_ptr<value_type *>(&v);
|
||||
alloc_traits::construct(a, (value_type*)&v, ::boost::forward<Args>(get<IdxPack>(this->args_))...);
|
||||
value_type *vp = move_detail::launder_cast<value_type *>(&v);
|
||||
BOOST_CONTAINER_TRY{
|
||||
*p = ::boost::move(*vp);
|
||||
}
|
||||
@@ -435,8 +436,8 @@ struct insert_emplace_proxy_arg##N\
|
||||
{\
|
||||
BOOST_ASSERT(n == 1); (void)n;\
|
||||
typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;\
|
||||
alloc_traits::construct(a, move_detail::force_ptr<value_type *>(&v) BOOST_MOVE_I##N BOOST_MOVE_MFWD##N);\
|
||||
value_type *vp = move_detail::force_ptr<value_type *>(&v);\
|
||||
alloc_traits::construct(a, (value_type*)&v BOOST_MOVE_I##N BOOST_MOVE_MFWD##N);\
|
||||
value_type *vp = move_detail::launder_cast<value_type *>(&v);\
|
||||
BOOST_CONTAINER_TRY{\
|
||||
*p = ::boost::move(*vp);\
|
||||
}\
|
||||
|
@@ -48,6 +48,7 @@
|
||||
#include <boost/move/adl_move_swap.hpp>
|
||||
#include <boost/move/detail/iterator_to_raw_pointer.hpp>
|
||||
#include <boost/move/detail/force_ptr.hpp>
|
||||
#include <boost/move/detail/launder.hpp>
|
||||
#include <boost/move/algo/adaptive_sort.hpp>
|
||||
#include <boost/move/algo/detail/pdqsort.hpp>
|
||||
|
||||
@@ -975,8 +976,8 @@ class flat_tree
|
||||
{
|
||||
typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;
|
||||
get_stored_allocator_noconst_return_t a = this->get_stored_allocator();
|
||||
stored_allocator_traits::construct(a, move_detail::force_ptr<value_type *>(&v), ::boost::forward<Args>(args)... );
|
||||
value_type *pval = move_detail::force_ptr<value_type *>(&v);
|
||||
stored_allocator_traits::construct(a, (value_type *)(&v), ::boost::forward<Args>(args)... );
|
||||
value_type *pval = move_detail::launder_cast<value_type *>(&v);
|
||||
value_destructor<stored_allocator_type, value_type> d(a, *pval);
|
||||
return this->insert_unique(::boost::move(*pval));
|
||||
}
|
||||
@@ -987,8 +988,8 @@ class flat_tree
|
||||
//hint checked in insert_unique
|
||||
typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;
|
||||
get_stored_allocator_noconst_return_t a = this->get_stored_allocator();
|
||||
stored_allocator_traits::construct(a, move_detail::force_ptr<value_type *>(&v), ::boost::forward<Args>(args)... );
|
||||
value_type *pval = move_detail::force_ptr<value_type *>(&v);
|
||||
stored_allocator_traits::construct(a, (value_type*)(&v), ::boost::forward<Args>(args)... );
|
||||
value_type *pval = move_detail::launder_cast<value_type *>(&v);
|
||||
value_destructor<stored_allocator_type, value_type> d(a, *pval);
|
||||
return this->insert_unique(hint, ::boost::move(*pval));
|
||||
}
|
||||
@@ -998,8 +999,8 @@ class flat_tree
|
||||
{
|
||||
typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;
|
||||
get_stored_allocator_noconst_return_t a = this->get_stored_allocator();
|
||||
stored_allocator_traits::construct(a, move_detail::force_ptr<value_type *>(&v), ::boost::forward<Args>(args)... );
|
||||
value_type *pval = move_detail::force_ptr<value_type *>(&v);
|
||||
stored_allocator_traits::construct(a, (value_type*)(&v), ::boost::forward<Args>(args)... );
|
||||
value_type *pval = move_detail::launder_cast<value_type *>(&v);
|
||||
value_destructor<stored_allocator_type, value_type> d(a, *pval);
|
||||
return this->insert_equal(::boost::move(*pval));
|
||||
}
|
||||
@@ -1010,8 +1011,8 @@ class flat_tree
|
||||
//hint checked in insert_equal
|
||||
typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;
|
||||
get_stored_allocator_noconst_return_t a = this->get_stored_allocator();
|
||||
stored_allocator_traits::construct(a, move_detail::force_ptr<value_type *>(&v), ::boost::forward<Args>(args)... );
|
||||
value_type *pval = move_detail::force_ptr<value_type *>(&v);
|
||||
stored_allocator_traits::construct(a, (value_type*)(&v), ::boost::forward<Args>(args)... );
|
||||
value_type *pval = move_detail::launder_cast<value_type *>(&v);
|
||||
value_destructor<stored_allocator_type, value_type> d(a, *pval);
|
||||
return this->insert_equal(hint, ::boost::move(*pval));
|
||||
}
|
||||
@@ -1044,8 +1045,8 @@ class flat_tree
|
||||
{\
|
||||
typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;\
|
||||
get_stored_allocator_noconst_return_t a = this->get_stored_allocator();\
|
||||
stored_allocator_traits::construct(a, move_detail::force_ptr<value_type *>(&v) BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
|
||||
value_type *pval = move_detail::force_ptr<value_type *>(&v);\
|
||||
stored_allocator_traits::construct(a, (value_type *)(&v) BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
|
||||
value_type *pval = move_detail::launder_cast<value_type *>(&v);\
|
||||
value_destructor<stored_allocator_type, value_type> d(a, *pval);\
|
||||
return this->insert_unique(::boost::move(*pval));\
|
||||
}\
|
||||
@@ -1055,8 +1056,8 @@ class flat_tree
|
||||
{\
|
||||
typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;\
|
||||
get_stored_allocator_noconst_return_t a = this->get_stored_allocator();\
|
||||
stored_allocator_traits::construct(a, move_detail::force_ptr<value_type *>(&v) BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
|
||||
value_type *pval = move_detail::force_ptr<value_type *>(&v);\
|
||||
stored_allocator_traits::construct(a, (value_type *)(&v) BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
|
||||
value_type *pval = move_detail::launder_cast<value_type *>(&v);\
|
||||
value_destructor<stored_allocator_type, value_type> d(a, *pval);\
|
||||
return this->insert_unique(hint, ::boost::move(*pval));\
|
||||
}\
|
||||
@@ -1066,8 +1067,8 @@ class flat_tree
|
||||
{\
|
||||
typename dtl::aligned_storage<sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;\
|
||||
get_stored_allocator_noconst_return_t a = this->get_stored_allocator();\
|
||||
stored_allocator_traits::construct(a, move_detail::force_ptr<value_type *>(&v) BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
|
||||
value_type *pval = move_detail::force_ptr<value_type *>(&v);\
|
||||
stored_allocator_traits::construct(a, (value_type *)(&v) BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
|
||||
value_type *pval = move_detail::launder_cast<value_type *>(&v);\
|
||||
value_destructor<stored_allocator_type, value_type> d(a, *pval);\
|
||||
return this->insert_equal(::boost::move(*pval));\
|
||||
}\
|
||||
@@ -1077,8 +1078,8 @@ class flat_tree
|
||||
{\
|
||||
typename dtl::aligned_storage <sizeof(value_type), dtl::alignment_of<value_type>::value>::type v;\
|
||||
get_stored_allocator_noconst_return_t a = this->get_stored_allocator();\
|
||||
stored_allocator_traits::construct(a, move_detail::force_ptr<value_type *>(&v) BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
|
||||
value_type *pval = move_detail::force_ptr<value_type *>(&v);\
|
||||
stored_allocator_traits::construct(a, (value_type *)(&v) BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
|
||||
value_type *pval = move_detail::launder_cast<value_type *>(&v);\
|
||||
value_destructor<stored_allocator_type, value_type> d(a, *pval);\
|
||||
return this->insert_equal(hint, ::boost::move(*pval));\
|
||||
}\
|
||||
|
@@ -31,6 +31,7 @@
|
||||
#include <boost/container/detail/construct_in_place.hpp>
|
||||
#include <boost/container/detail/destroyers.hpp>
|
||||
#include <boost/move/detail/iterator_to_raw_pointer.hpp>
|
||||
#include <boost/move/detail/launder.hpp>
|
||||
#include <boost/container/detail/mpl.hpp>
|
||||
#include <boost/container/detail/placement_new.hpp>
|
||||
#include <boost/move/detail/to_raw_pointer.hpp>
|
||||
@@ -119,16 +120,16 @@ struct base_node
|
||||
}
|
||||
|
||||
inline T &get_data()
|
||||
{ return *move_detail::force_ptr<T*>(this->m_storage.data); }
|
||||
{ return *move_detail::force_ptr<T*>(&this->m_storage); }
|
||||
|
||||
inline const T &get_data() const
|
||||
{ return *move_detail::force_ptr<const T*>(this->m_storage.data); }
|
||||
{ return *move_detail::launder_cast<const T*>(&this->m_storage); }
|
||||
|
||||
inline internal_type &get_real_data()
|
||||
{ return *move_detail::force_ptr<internal_type*>(this->m_storage.data); }
|
||||
{ return *move_detail::launder_cast<internal_type*>(&this->m_storage); }
|
||||
|
||||
inline const internal_type &get_real_data() const
|
||||
{ return *move_detail::force_ptr<const internal_type*>(this->m_storage.data); }
|
||||
{ return *move_detail::launder_cast<const internal_type*>(&this->m_storage); }
|
||||
|
||||
#if defined(BOOST_CONTAINER_DISABLE_ALIASING_WARNING)
|
||||
#pragma GCC diagnostic pop
|
||||
|
@@ -52,7 +52,6 @@
|
||||
#include <boost/move/detail/fwd_macros.hpp>
|
||||
#endif
|
||||
#include <boost/move/detail/move_helpers.hpp>
|
||||
#include <boost/move/detail/force_ptr.hpp>
|
||||
|
||||
|
||||
|
||||
|
@@ -46,7 +46,6 @@
|
||||
#include <boost/move/utility_core.hpp>
|
||||
#include <boost/move/detail/to_raw_pointer.hpp>
|
||||
#include <boost/move/algo/detail/merge.hpp>
|
||||
#include <boost/move/detail/force_ptr.hpp>
|
||||
|
||||
//std
|
||||
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||
|
@@ -43,7 +43,6 @@
|
||||
# include <boost/move/detail/fwd_macros.hpp>
|
||||
#endif
|
||||
#include <boost/move/detail/move_helpers.hpp>
|
||||
#include <boost/move/detail/force_ptr.hpp>
|
||||
|
||||
// intrusive
|
||||
#include <boost/intrusive/pointer_traits.hpp>
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include <boost/container/detail/workaround.hpp>
|
||||
#include <boost/container/detail/placement_new.hpp>
|
||||
#include <boost/move/detail/to_raw_pointer.hpp>
|
||||
#include <boost/move/detail/launder.hpp>
|
||||
#include <boost/container/allocator_traits.hpp>
|
||||
#include <boost/container/detail/mpl.hpp>
|
||||
|
||||
@@ -146,7 +147,7 @@ class node_handle
|
||||
}
|
||||
|
||||
void destroy_alloc() BOOST_NOEXCEPT
|
||||
{ static_cast<nallocator_type*>((void*)m_nalloc_storage.data)->~nallocator_type(); }
|
||||
{ move_detail::launder_cast<nallocator_type*>(&m_nalloc_storage)->~nallocator_type(); }
|
||||
|
||||
node_pointer &get_node_pointer() BOOST_NOEXCEPT
|
||||
{ return m_ptr; }
|
||||
@@ -381,7 +382,7 @@ class node_handle
|
||||
nallocator_type &node_alloc() BOOST_NOEXCEPT
|
||||
{
|
||||
BOOST_ASSERT(!empty());
|
||||
return *static_cast<nallocator_type*>((void*)m_nalloc_storage.data);
|
||||
return *move_detail::launder_cast<nallocator_type*>(&m_nalloc_storage);
|
||||
}
|
||||
|
||||
|
||||
@@ -391,7 +392,7 @@ class node_handle
|
||||
const nallocator_type &node_alloc() const BOOST_NOEXCEPT
|
||||
{
|
||||
BOOST_ASSERT(!empty());
|
||||
return *static_cast<const nallocator_type*>((const void*)m_nalloc_storage.data);
|
||||
return *move_detail::launder_cast<const nallocator_type*>(&m_nalloc_storage);
|
||||
}
|
||||
|
||||
//! <b>Effects</b>: x.swap(y).
|
||||
|
@@ -47,7 +47,7 @@
|
||||
#include <boost/move/detail/fwd_macros.hpp>
|
||||
#endif
|
||||
#include <boost/move/detail/move_helpers.hpp>
|
||||
#include <boost/move/detail/force_ptr.hpp>
|
||||
|
||||
// std
|
||||
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||
#include <initializer_list>
|
||||
|
@@ -39,7 +39,6 @@
|
||||
#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
#include <boost/move/detail/fwd_macros.hpp>
|
||||
#endif
|
||||
#include <boost/move/detail/force_ptr.hpp>
|
||||
|
||||
//std
|
||||
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||
@@ -488,7 +487,7 @@ template<class T, class VoidAlloc, class Options>
|
||||
inline typename small_vector_allocator<T, VoidAlloc, Options>::const_pointer
|
||||
small_vector_allocator<T, VoidAlloc, Options>::internal_storage() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
const vector_type& v = reinterpret_cast<const vector_type&>(*this);
|
||||
const vector_type& v = *static_cast<const vector_type*>(static_cast<const void *>(this));
|
||||
BOOST_ASSERT((std::size_t(this) % dtl::alignment_of< small_vector_storage_offset<T, allocator_type, Options> >::value) == 0);
|
||||
const char *addr = reinterpret_cast<const char*>(&v);
|
||||
typedef typename boost::intrusive::pointer_traits<pointer>::template rebind_pointer<const char>::type const_char_pointer;
|
||||
@@ -501,7 +500,7 @@ template <class T, class VoidAlloc, class Options>
|
||||
inline typename small_vector_allocator<T, VoidAlloc, Options>::pointer
|
||||
small_vector_allocator<T, VoidAlloc, Options>::internal_storage() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
vector_type& v = reinterpret_cast<vector_type&>(*this);
|
||||
vector_type& v = *static_cast<vector_type*>(static_cast<void*>(this));
|
||||
BOOST_ASSERT((std::size_t(this) % dtl::alignment_of< small_vector_storage_offset<T, allocator_type, Options> >::value) == 0);
|
||||
char* addr = reinterpret_cast<char*>(&v);
|
||||
typedef typename boost::intrusive::pointer_traits<pointer>::template rebind_pointer<char>::type char_pointer;
|
||||
|
@@ -54,7 +54,7 @@
|
||||
#include <boost/move/utility_core.hpp>
|
||||
#include <boost/move/iterator.hpp>
|
||||
#include <boost/move/adl_move_swap.hpp>
|
||||
#include <boost/move/detail/force_ptr.hpp>
|
||||
#include <boost/move/detail/launder.hpp>
|
||||
// move/detail
|
||||
#include <boost/move/detail/move_helpers.hpp>
|
||||
#include <boost/move/detail/iterator_to_raw_pointer.hpp>
|
||||
@@ -166,19 +166,19 @@ struct node
|
||||
# endif
|
||||
|
||||
inline T &get_data()
|
||||
{ return *boost::move_detail::force_ptr<T*>(this->m_storage.data); }
|
||||
{ return *boost::move_detail::launder_cast<T*>(&this->m_storage); }
|
||||
|
||||
inline const T &get_data() const
|
||||
{ return *boost::move_detail::force_ptr<const T*>(this->m_storage.data); }
|
||||
{ return *boost::move_detail::launder_cast<const T*>(&this->m_storage); }
|
||||
|
||||
inline T *get_data_ptr()
|
||||
{ return boost::move_detail::force_ptr<T*>(this->m_storage.data); }
|
||||
{ return boost::move_detail::launder_cast<T*>(&this->m_storage); }
|
||||
|
||||
inline const T *get_data_ptr() const
|
||||
{ return boost::move_detail::force_ptr<const T*>(this->m_storage.data); }
|
||||
{ return boost::move_detail::launder_cast<const T*>(&this->m_storage); }
|
||||
|
||||
inline ~node()
|
||||
{ boost::move_detail::force_ptr<T*>(this->m_storage.data)->~T(); }
|
||||
{ boost::move_detail::launder_cast<T*>(&this->m_storage)->~T(); }
|
||||
|
||||
#if defined(BOOST_CONTAINER_DISABLE_ALIASING_WARNING)
|
||||
#pragma GCC diagnostic pop
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#include <boost/container/detail/config_begin.hpp>
|
||||
#include <boost/container/detail/workaround.hpp>
|
||||
#include <boost/container/detail/type_traits.hpp>
|
||||
#include <boost/move/detail/launder.hpp>
|
||||
#include <boost/container/vector.hpp>
|
||||
|
||||
#include <cstddef>
|
||||
@@ -63,10 +64,7 @@ class static_storage_allocator
|
||||
{ return *this; }
|
||||
|
||||
inline T* internal_storage() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return const_cast<T*>(static_cast<const T*>(static_cast<const void*>(storage.data))); }
|
||||
|
||||
inline T* internal_storage() BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return static_cast<T*>(static_cast<void*>(storage.data)); }
|
||||
{ return move_detail::launder_cast<T*>(&storage); }
|
||||
|
||||
static const std::size_t internal_capacity = N;
|
||||
|
||||
|
@@ -43,7 +43,7 @@
|
||||
//intrusive
|
||||
#include <boost/intrusive/pointer_traits.hpp>
|
||||
#include <boost/intrusive/detail/hash_combine.hpp>
|
||||
#include <boost/move/detail/force_ptr.hpp>
|
||||
#include <boost/move/detail/launder.hpp>
|
||||
//move
|
||||
#include <boost/move/utility_core.hpp>
|
||||
#include <boost/move/adl_move_swap.hpp>
|
||||
@@ -226,7 +226,7 @@ class basic_string_base
|
||||
{
|
||||
inline void init()
|
||||
{
|
||||
short_t &s = *::new(this->m_repr.data) short_t;
|
||||
short_t &s = *::new(&this->m_repr) short_t;
|
||||
s.h.is_short = 1;
|
||||
s.h.length = 0;
|
||||
}
|
||||
@@ -241,16 +241,16 @@ class basic_string_base
|
||||
{ this->init(); }
|
||||
|
||||
inline const short_t *pshort_repr() const
|
||||
{ return move_detail::force_ptr<const short_t*>(m_repr.data); }
|
||||
{ return move_detail::launder_cast<const short_t*>(&m_repr); }
|
||||
|
||||
inline const long_t *plong_repr() const
|
||||
{ return move_detail::force_ptr<const long_t*>(m_repr.data); }
|
||||
{ return move_detail::launder_cast<const long_t*>(&m_repr); }
|
||||
|
||||
inline short_t *pshort_repr()
|
||||
{ return move_detail::force_ptr<short_t*>(m_repr.data); }
|
||||
{ return move_detail::launder_cast<short_t*>(&m_repr); }
|
||||
|
||||
inline long_t *plong_repr()
|
||||
{ return move_detail::force_ptr<long_t*>(m_repr.data); }
|
||||
{ return move_detail::launder_cast<long_t*>(&m_repr); }
|
||||
|
||||
repr_t m_repr;
|
||||
} members_;
|
||||
@@ -280,7 +280,7 @@ class basic_string_base
|
||||
|
||||
inline short_t *construct_short()
|
||||
{
|
||||
short_t *ps = ::new(this->members_.m_repr.data) short_t;
|
||||
short_t *ps = ::new(&this->members_.m_repr) short_t;
|
||||
ps->h.is_short = 1;
|
||||
return ps;
|
||||
}
|
||||
@@ -302,7 +302,7 @@ class basic_string_base
|
||||
|
||||
inline long_t *construct_long()
|
||||
{
|
||||
long_t *pl = ::new(this->members_.m_repr.data) long_t;
|
||||
long_t *pl = ::new(&this->members_.m_repr) long_t;
|
||||
//is_short flag is written in the constructor
|
||||
return pl;
|
||||
}
|
||||
|
@@ -545,7 +545,7 @@ struct vector_alloc_holder
|
||||
inline const allocator_type &alloc() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return *this; }
|
||||
|
||||
inline const pointer &start() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
inline pointer start() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return m_start; }
|
||||
inline size_type capacity() const BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{ return m_capacity; }
|
||||
@@ -2807,12 +2807,19 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (push)
|
||||
#pragma warning(disable: 4702) //Disable unreachable code warning
|
||||
#endif
|
||||
template <class InsertionProxy>
|
||||
inline iterator priv_insert_forward_range_no_capacity
|
||||
(T * const, const size_type, const InsertionProxy , version_0)
|
||||
{
|
||||
return alloc_holder_t::on_capacity_overflow(), iterator();
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (pop)
|
||||
#endif
|
||||
|
||||
template <class InsertionProxy>
|
||||
BOOST_CONTAINER_NOINLINE iterator priv_insert_forward_range_no_capacity
|
||||
|
@@ -1,185 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{58CCE183-6092-48FE-A4F7-BA0D3A792655}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>15.0.27625.0</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(Platform)\$(Configuration)\$(TargetName)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\Int\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>$(ProjectName)</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>$(ProjectName)</TargetName>
|
||||
<OutDir>$(Platform)\$(Configuration)\$(TargetName)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\Int\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(Platform)\$(Configuration)\$(TargetName)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\Int\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(Platform)\$(Configuration)\$(TargetName)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\Int\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<LanguageStandard>Default</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>../../../../stage/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)deque_test.pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<FixedBaseAddress>false</FixedBaseAddress>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<LanguageStandard>Default</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>../../../../stage/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)deque_test.pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<FixedBaseAddress>false</FixedBaseAddress>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat />
|
||||
<LanguageStandard>Default</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>../../../../stage/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<FixedBaseAddress>false</FixedBaseAddress>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>
|
||||
</DebugInformationFormat>
|
||||
<LanguageStandard>Default</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>../../../../stage/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<FixedBaseAddress>false</FixedBaseAddress>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\test\deque_test.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@@ -1,184 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{5E11C8D3-FA52-760A-84FE-943A6BA05A21}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>15.0.27625.0</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(Platform)\$(Configuration)\$(TargetName)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\Int\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>$(ProjectName)</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>$(ProjectName)</TargetName>
|
||||
<OutDir>$(Platform)\$(Configuration)\$(TargetName)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\Int\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(Platform)\$(Configuration)\$(TargetName)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\Int\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(Platform)\$(Configuration)\$(TargetName)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\Int\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<LanguageStandard>Default</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>../../../../stage/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)stable_vector_test.pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<FixedBaseAddress>false</FixedBaseAddress>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<LanguageStandard>Default</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>../../../../stage/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)stable_vector_test.pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<FixedBaseAddress>false</FixedBaseAddress>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<LanguageStandard>Default</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>../../../../stage/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<FixedBaseAddress>false</FixedBaseAddress>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>../../../..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<LanguageStandard>Default</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>../../../../stage/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<FixedBaseAddress>false</FixedBaseAddress>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\test\stable_vector_test.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@@ -14,7 +14,6 @@
|
||||
#include <boost/container/uses_allocator.hpp>
|
||||
#include <boost/container/detail/mpl.hpp>
|
||||
#include <boost/move/core.hpp>
|
||||
#include <boost/move/detail/force_ptr.hpp>
|
||||
|
||||
template<class T, unsigned int Id, bool HasTrueTypes = false>
|
||||
class propagation_test_allocator
|
||||
@@ -69,11 +68,18 @@ class propagation_test_allocator
|
||||
std::size_t max_size() const
|
||||
{ return std::size_t(-1); }
|
||||
|
||||
T* allocate(std::size_t n)
|
||||
{ return boost::move_detail::force_ptr<T*>(::new char[n*sizeof(T)]); }
|
||||
value_type* allocate(std::size_t count)
|
||||
{ return static_cast<value_type*>(::operator new(count * sizeof(value_type))); }
|
||||
|
||||
void deallocate(T*p, std::size_t)
|
||||
{ delete []static_cast<char*>(static_cast<void*>(p)); }
|
||||
void deallocate(value_type *ptr, std::size_t n)
|
||||
{
|
||||
(void)n;
|
||||
# if __cpp_sized_deallocation
|
||||
::operator delete((void*)ptr, n * sizeof(value_type));
|
||||
#else
|
||||
::operator delete((void*)ptr);
|
||||
# endif
|
||||
}
|
||||
|
||||
bool m_move_contructed;
|
||||
bool m_move_assigned;
|
||||
|
@@ -366,11 +366,13 @@ int main ()
|
||||
std::cerr << "test_cont_variants< std::allocator<void> > failed" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// boost::container::allocator
|
||||
if(test_cont_variants< allocator<void> >()){
|
||||
std::cerr << "test_cont_variants< allocator<void> > failed" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
////////////////////////////////////
|
||||
// Default init test
|
||||
////////////////////////////////////
|
||||
@@ -406,10 +408,14 @@ int main ()
|
||||
////////////////////////////////////
|
||||
{
|
||||
typedef boost::container::deque<int> cont_int;
|
||||
cont_int a; a.push_back(0); a.push_back(1); a.push_back(2);
|
||||
boost::intrusive::test::test_iterator_random< cont_int >(a);
|
||||
if(boost::report_errors() != 0) {
|
||||
return 1;
|
||||
for(std::size_t i = 1; i <= 10000; i*=10){
|
||||
cont_int a;
|
||||
for (int j = 0; j < (int)i; ++j)
|
||||
a.push_back((int)j);
|
||||
boost::intrusive::test::test_iterator_random< cont_int >(a);
|
||||
if(boost::report_errors() != 0) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -4029,10 +4029,14 @@ int main()
|
||||
////////////////////////////////////
|
||||
{
|
||||
typedef boost::container::devector<int> cont_int;
|
||||
cont_int a; a.push_back(0); a.push_back(1); a.push_back(2);
|
||||
boost::intrusive::test::test_iterator_random< cont_int >(a);
|
||||
if (boost::report_errors() != 0) {
|
||||
return 1;
|
||||
for (std::size_t i = 10; i <= 10000; i *= 10) {
|
||||
cont_int a;
|
||||
for (int j = 0; j < (int)i; ++j)
|
||||
a.push_back((int)j);
|
||||
boost::intrusive::test::test_iterator_random< cont_int >(a);
|
||||
if (boost::report_errors() != 0) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -34,7 +34,6 @@
|
||||
|
||||
#include <boost/move/utility_core.hpp>
|
||||
#include <boost/move/adl_move_swap.hpp>
|
||||
#include <boost/move/detail/force_ptr.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
#include <memory>
|
||||
@@ -61,10 +60,17 @@ class simple_allocator
|
||||
{}
|
||||
|
||||
T* allocate(std::size_t n)
|
||||
{ return move_detail::force_ptr<T*>(::new char[sizeof(T)*n]); }
|
||||
{ return (T*) ::operator new(sizeof(T) * n); }
|
||||
|
||||
void deallocate(T*p, std::size_t)
|
||||
{ delete[] ((char*)p);}
|
||||
void deallocate(T *ptr, std::size_t n) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
(void)n;
|
||||
# if __cpp_sized_deallocation
|
||||
::operator delete((void*)ptr, n * sizeof(T));
|
||||
#else
|
||||
::operator delete((void*)ptr);
|
||||
# endif
|
||||
}
|
||||
|
||||
friend bool operator==(const simple_allocator &, const simple_allocator &)
|
||||
{ return true; }
|
||||
@@ -176,10 +182,17 @@ class propagation_test_allocator
|
||||
{ unique_id_ = id; }
|
||||
|
||||
T* allocate(std::size_t n)
|
||||
{ return move_detail::force_ptr<T*>(::new char[sizeof(T)*n]); }
|
||||
{ return static_cast<T*>(::operator new(n * sizeof(T))); }
|
||||
|
||||
void deallocate(T*p, std::size_t)
|
||||
{ delete[] ((char*)p);}
|
||||
void deallocate(T *ptr, std::size_t n) BOOST_NOEXCEPT_OR_NOTHROW
|
||||
{
|
||||
(void)n;
|
||||
# if __cpp_sized_deallocation
|
||||
::operator delete((void*)ptr, n * sizeof(T));
|
||||
#else
|
||||
::operator delete((void*)ptr);
|
||||
# endif
|
||||
}
|
||||
|
||||
friend bool operator==(const propagation_test_allocator &a, const propagation_test_allocator &b)
|
||||
{ return EqualIfEqualIds ? a.id_ == b.id_ : true; }
|
||||
|
@@ -17,7 +17,7 @@
|
||||
#include <boost/container/detail/mpl.hpp>
|
||||
#include <boost/move/utility_core.hpp>
|
||||
#include <boost/container/detail/type_traits.hpp>
|
||||
#include <boost/move/detail/force_ptr.hpp> //adl_move_swap
|
||||
#include <boost/move/detail/launder.hpp> //adl_move_swap
|
||||
|
||||
namespace boost{
|
||||
namespace container {
|
||||
@@ -152,7 +152,7 @@ static boost::container::dtl::aligned_storage<sizeof(EmplaceIntPair)*10>::type p
|
||||
|
||||
static EmplaceIntPair* initialize_emplace_int_pair()
|
||||
{
|
||||
EmplaceIntPair* ret = move_detail::force_ptr<EmplaceIntPair*>(&pair_storage);
|
||||
EmplaceIntPair* ret = move_detail::launder_cast<EmplaceIntPair*>(&pair_storage);
|
||||
for(unsigned int i = 0; i != 10; ++i){
|
||||
new(&ret->first)EmplaceInt();
|
||||
new(&ret->second)EmplaceInt();
|
||||
|
@@ -22,7 +22,6 @@ volatile ::boost::container::vector<empty> dummy;
|
||||
#include <boost/container/allocator.hpp>
|
||||
#include "movable_int.hpp"
|
||||
#include "dummy_test_allocator.hpp"
|
||||
#include <boost/move/detail/force_ptr.hpp>
|
||||
|
||||
class CustomAllocator
|
||||
{
|
||||
@@ -34,10 +33,17 @@ class CustomAllocator
|
||||
typedef short difference_type;
|
||||
|
||||
pointer allocate(size_type count)
|
||||
{ return boost::move_detail::force_ptr<pointer>(new char[sizeof(value_type)*count]); }
|
||||
{ return static_cast<value_type*>(::operator new(count * sizeof(value_type))); }
|
||||
|
||||
void deallocate(pointer ptr, size_type )
|
||||
{ delete [](char*)ptr; }
|
||||
void deallocate(pointer ptr, size_type n)
|
||||
{
|
||||
(void)n;
|
||||
# if __cpp_sized_deallocation
|
||||
::operator delete((void*)ptr, n * sizeof(value_type));
|
||||
#else
|
||||
::operator delete((void*)ptr);
|
||||
# endif
|
||||
}
|
||||
|
||||
friend bool operator==(CustomAllocator const&, CustomAllocator const&) BOOST_NOEXCEPT
|
||||
{ return true; }
|
||||
|
@@ -244,11 +244,15 @@ int main()
|
||||
// Iterator testing
|
||||
////////////////////////////////////
|
||||
{
|
||||
typedef boost::container::small_vector<int, 0> cont_int;
|
||||
cont_int a; a.push_back(0); a.push_back(1); a.push_back(2);
|
||||
boost::intrusive::test::test_iterator_random< cont_int >(a);
|
||||
if(boost::report_errors() != 0) {
|
||||
return 1;
|
||||
typedef boost::container::small_vector<int, 10> cont_int;
|
||||
for (std::size_t i = 10; i <= 10000; i *= 10) {
|
||||
cont_int a;
|
||||
for (int j = 0; j < (int)i; ++j)
|
||||
a.push_back((int)j);
|
||||
boost::intrusive::test::test_iterator_random< cont_int >(a);
|
||||
if (boost::report_errors() != 0) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -173,10 +173,14 @@ int main()
|
||||
////////////////////////////////////
|
||||
{
|
||||
typedef boost::container::stable_vector<int> cont_int;
|
||||
cont_int a; a.push_back(0); a.push_back(1); a.push_back(2);
|
||||
boost::intrusive::test::test_iterator_random< cont_int >(a);
|
||||
if(boost::report_errors() != 0) {
|
||||
return 1;
|
||||
for (std::size_t i = 10; i <= 10000; i *= 10) {
|
||||
cont_int a;
|
||||
for (int j = 0; j < (int)i; ++j)
|
||||
a.push_back((int)j);
|
||||
boost::intrusive::test::test_iterator_random< cont_int >(a);
|
||||
if (boost::report_errors() != 0) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -630,7 +630,7 @@ bool default_init_test()//Test for default initialization
|
||||
typedef static_vector<unsigned char, Capacity> di_vector_t;
|
||||
|
||||
{
|
||||
typename dtl::aligned_storage<sizeof(di_vector_t)>::type as;
|
||||
dtl::aligned_storage<sizeof(di_vector_t)>::type as;
|
||||
di_vector_t *pv = ::new(as.data)di_vector_t(Capacity);
|
||||
|
||||
//Use volatile pointer to make compiler's job harder, as we are riding on UB
|
||||
|
@@ -331,10 +331,14 @@ int main()
|
||||
////////////////////////////////////
|
||||
{
|
||||
typedef boost::container::vector<int> cont_int;
|
||||
cont_int a; a.push_back(0); a.push_back(1); a.push_back(2);
|
||||
boost::intrusive::test::test_iterator_random< cont_int >(a);
|
||||
if(boost::report_errors() != 0) {
|
||||
return 1;
|
||||
for (std::size_t i = 10; i <= 10000; i *= 10) {
|
||||
cont_int a;
|
||||
for (int j = 0; j < (int)i; ++j)
|
||||
a.push_back((int)j);
|
||||
boost::intrusive::test::test_iterator_random< cont_int >(a);
|
||||
if (boost::report_errors() != 0) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user