forked from boostorg/container
Removed trailing whitespaces
This commit is contained in:
@@ -144,7 +144,7 @@ void list_test_template(std::size_t num_iterations, std::size_t num_elements, bo
|
|||||||
}
|
}
|
||||||
timer.stop();
|
timer.stop();
|
||||||
tinsert = timer.elapsed().wall;
|
tinsert = timer.elapsed().wall;
|
||||||
|
|
||||||
insert_inuse = boost_cont_in_use_memory();
|
insert_inuse = boost_cont_in_use_memory();
|
||||||
insert_stats = boost_cont_malloc_stats();
|
insert_stats = boost_cont_malloc_stats();
|
||||||
/*
|
/*
|
||||||
@@ -248,7 +248,7 @@ void list_test_template(std::size_t num_iterations, std::size_t num_elements, bo
|
|||||||
|
|
||||||
void print_header()
|
void print_header()
|
||||||
{
|
{
|
||||||
std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";"
|
std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";"
|
||||||
<< "Insertion time(ns)" << ";"
|
<< "Insertion time(ns)" << ";"
|
||||||
<< "System bytes" << ";"
|
<< "System bytes" << ";"
|
||||||
<< "System overhead(%)" << ";"
|
<< "System overhead(%)" << ";"
|
||||||
|
@@ -86,8 +86,8 @@ struct has_trivial_destructor_after_move<MyInt>
|
|||||||
|
|
||||||
void print_header()
|
void print_header()
|
||||||
{
|
{
|
||||||
std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";"
|
std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";"
|
||||||
<< "Capacity" << ";" << "push_back(ns)" << ";" << "Allocator calls" << ";"
|
<< "Capacity" << ";" << "push_back(ns)" << ";" << "Allocator calls" << ";"
|
||||||
<< "New allocations" << ";" << "Bwd expansions" << std::endl;
|
<< "New allocations" << ";" << "Bwd expansions" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -228,8 +228,8 @@ void vector_test_template(unsigned int num_iterations, unsigned int num_elements
|
|||||||
|
|
||||||
void print_header()
|
void print_header()
|
||||||
{
|
{
|
||||||
std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";"
|
std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";"
|
||||||
<< "Capacity" << ";" << "push_back(ns)" << ";" << "Allocator calls" << ";"
|
<< "Capacity" << ";" << "push_back(ns)" << ";" << "Allocator calls" << ";"
|
||||||
<< "New allocations" << ";" << "Fwd expansions" << std::endl;
|
<< "New allocations" << ";" << "Fwd expansions" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -65,7 +65,7 @@ class MyInt
|
|||||||
|
|
||||||
void print_header()
|
void print_header()
|
||||||
{
|
{
|
||||||
std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";"
|
std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";"
|
||||||
<< "num_shrink" << ";" << "shrink_to_fit(ns)" << std::endl;
|
<< "num_shrink" << ";" << "shrink_to_fit(ns)" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -148,7 +148,7 @@ void stable_vector_test_template(unsigned int num_iterations, unsigned int num_e
|
|||||||
timer.start();
|
timer.start();
|
||||||
|
|
||||||
for(unsigned int r = 0; r != num_iterations; ++r){
|
for(unsigned int r = 0; r != num_iterations; ++r){
|
||||||
std::size_t init_pos = (num_iterations-1)-r;
|
std::size_t init_pos = (num_iterations-1)-r;
|
||||||
l.erase(ranges_to_erase[init_pos], l.end());
|
l.erase(ranges_to_erase[init_pos], l.end());
|
||||||
}
|
}
|
||||||
timer.stop();
|
timer.stop();
|
||||||
@@ -180,7 +180,7 @@ void stable_vector_test_template(unsigned int num_iterations, unsigned int num_e
|
|||||||
|
|
||||||
void print_header()
|
void print_header()
|
||||||
{
|
{
|
||||||
std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";"
|
std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";"
|
||||||
<< "Insertion time(ns)" << ";" << "Erasure time(ns)" << ";"
|
<< "Insertion time(ns)" << ";" << "Erasure time(ns)" << ";"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
|
@@ -53,13 +53,13 @@ template <typename Value, std::size_t Capacity, typename Strategy>
|
|||||||
class varray;
|
class varray;
|
||||||
|
|
||||||
namespace strategy {
|
namespace strategy {
|
||||||
|
|
||||||
// TODO: Improve error messages
|
// TODO: Improve error messages
|
||||||
// possibly include N in the strategy, and provide size as an optoinal allocate_failed parameter?
|
// possibly include N in the strategy, and provide size as an optoinal allocate_failed parameter?
|
||||||
// Example of current error with reserve(4) when capacity is 3:
|
// Example of current error with reserve(4) when capacity is 3:
|
||||||
// "boost/container/varray.hpp(66): size can't exceed the capacity"
|
// "boost/container/varray.hpp(66): size can't exceed the capacity"
|
||||||
// Could say
|
// Could say
|
||||||
// "cannot reserve(4) due to fixed capacity of 3 elements"
|
// "cannot reserve(4) due to fixed capacity of 3 elements"
|
||||||
|
|
||||||
//! @brief The default strategy.
|
//! @brief The default strategy.
|
||||||
//!
|
//!
|
||||||
@@ -189,12 +189,12 @@ struct varray_traits
|
|||||||
* change in size, along with the static allocation, low overhead, and fixed capacity of boost::array.
|
* change in size, along with the static allocation, low overhead, and fixed capacity of boost::array.
|
||||||
*
|
*
|
||||||
* A varray is a sequence that supports random access to elements, constant time insertion and
|
* A varray is a sequence that supports random access to elements, constant time insertion and
|
||||||
* removal of elements at the end, and linear time insertion and removal of elements at the beginning or
|
* removal of elements at the end, and linear time insertion and removal of elements at the beginning or
|
||||||
* in the middle. The number of elements in a varray may vary dynamically up to a fixed capacity
|
* in the middle. The number of elements in a varray may vary dynamically up to a fixed capacity
|
||||||
* because elements are stored within the object itself similarly to an array. However, objects are
|
* because elements are stored within the object itself similarly to an array. However, objects are
|
||||||
* initialized as they are inserted into varray unlike C arrays or std::array which must construct
|
* initialized as they are inserted into varray unlike C arrays or std::array which must construct
|
||||||
* all elements on instantiation. The behavior of varray enables the use of statically allocated
|
* all elements on instantiation. The behavior of varray enables the use of statically allocated
|
||||||
* elements in cases with complex object lifetime requirements that would otherwise not be trivially
|
* elements in cases with complex object lifetime requirements that would otherwise not be trivially
|
||||||
* possible.
|
* possible.
|
||||||
*
|
*
|
||||||
* @par Error Handling
|
* @par Error Handling
|
||||||
@@ -219,7 +219,7 @@ class varray
|
|||||||
typedef container_detail::varray_traits<
|
typedef container_detail::varray_traits<
|
||||||
Value, Capacity, Strategy
|
Value, Capacity, Strategy
|
||||||
> vt;
|
> vt;
|
||||||
|
|
||||||
typedef typename vt::error_handler errh;
|
typedef typename vt::error_handler errh;
|
||||||
|
|
||||||
BOOST_MPL_ASSERT_MSG(
|
BOOST_MPL_ASSERT_MSG(
|
||||||
@@ -354,7 +354,7 @@ public:
|
|||||||
: m_size(0)
|
: m_size(0)
|
||||||
{
|
{
|
||||||
//BOOST_CONCEPT_ASSERT((boost_concepts::ForwardTraversal<Iterator>)); // Make sure you passed a ForwardIterator
|
//BOOST_CONCEPT_ASSERT((boost_concepts::ForwardTraversal<Iterator>)); // Make sure you passed a ForwardIterator
|
||||||
|
|
||||||
this->assign(first, last); // may throw
|
this->assign(first, last); // may throw
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -393,7 +393,7 @@ public:
|
|||||||
: m_size(other.size())
|
: m_size(other.size())
|
||||||
{
|
{
|
||||||
errh::check_capacity(*this, other.size()); // may throw
|
errh::check_capacity(*this, other.size()); // may throw
|
||||||
|
|
||||||
namespace sv = varray_detail;
|
namespace sv = varray_detail;
|
||||||
sv::uninitialized_copy(other.begin(), other.end(), this->begin()); // may throw
|
sv::uninitialized_copy(other.begin(), other.end(), this->begin()); // may throw
|
||||||
}
|
}
|
||||||
@@ -610,7 +610,7 @@ public:
|
|||||||
typedef typename
|
typedef typename
|
||||||
vt::use_optimized_swap use_optimized_swap;
|
vt::use_optimized_swap use_optimized_swap;
|
||||||
|
|
||||||
this->swap_dispatch(other, use_optimized_swap());
|
this->swap_dispatch(other, use_optimized_swap());
|
||||||
}
|
}
|
||||||
|
|
||||||
//! @pre <tt>count <= capacity()</tt>
|
//! @pre <tt>count <= capacity()</tt>
|
||||||
@@ -672,7 +672,7 @@ public:
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
errh::check_capacity(*this, count); // may throw
|
errh::check_capacity(*this, count); // may throw
|
||||||
|
|
||||||
std::uninitialized_fill(this->end(), this->begin() + count, value); // may throw
|
std::uninitialized_fill(this->end(), this->begin() + count, value); // may throw
|
||||||
}
|
}
|
||||||
m_size = count; // update end
|
m_size = count; // update end
|
||||||
@@ -716,7 +716,7 @@ public:
|
|||||||
typedef typename vt::disable_trivial_init dti;
|
typedef typename vt::disable_trivial_init dti;
|
||||||
|
|
||||||
errh::check_capacity(*this, m_size + 1); // may throw
|
errh::check_capacity(*this, m_size + 1); // may throw
|
||||||
|
|
||||||
namespace sv = varray_detail;
|
namespace sv = varray_detail;
|
||||||
sv::construct(dti(), this->end(), value); // may throw
|
sv::construct(dti(), this->end(), value); // may throw
|
||||||
++m_size; // update end
|
++m_size; // update end
|
||||||
@@ -844,7 +844,7 @@ public:
|
|||||||
namespace sv = varray_detail;
|
namespace sv = varray_detail;
|
||||||
|
|
||||||
difference_type to_move = std::distance(position, this->end());
|
difference_type to_move = std::distance(position, this->end());
|
||||||
|
|
||||||
// TODO - should following lines check for exception and revert to the old size?
|
// TODO - should following lines check for exception and revert to the old size?
|
||||||
|
|
||||||
if ( count < static_cast<size_type>(to_move) )
|
if ( count < static_cast<size_type>(to_move) )
|
||||||
@@ -945,9 +945,9 @@ public:
|
|||||||
|
|
||||||
errh::check_iterator_end_eq(*this, first);
|
errh::check_iterator_end_eq(*this, first);
|
||||||
errh::check_iterator_end_eq(*this, last);
|
errh::check_iterator_end_eq(*this, last);
|
||||||
|
|
||||||
difference_type n = std::distance(first, last);
|
difference_type n = std::distance(first, last);
|
||||||
|
|
||||||
//TODO - add invalid range check?
|
//TODO - add invalid range check?
|
||||||
//BOOST_ASSERT_MSG(0 <= n, "invalid range");
|
//BOOST_ASSERT_MSG(0 <= n, "invalid range");
|
||||||
//TODO - add this->size() check?
|
//TODO - add this->size() check?
|
||||||
@@ -1346,7 +1346,7 @@ public:
|
|||||||
return boost::addressof(*(this->ptr()));
|
return boost::addressof(*(this->ptr()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! @brief Returns iterator to the first element.
|
//! @brief Returns iterator to the first element.
|
||||||
//!
|
//!
|
||||||
//! @return iterator to the first element contained in the vector.
|
//! @return iterator to the first element contained in the vector.
|
||||||
@@ -1606,7 +1606,7 @@ private:
|
|||||||
typename varray<value_type, C, S>::aligned_storage_type
|
typename varray<value_type, C, S>::aligned_storage_type
|
||||||
>::type
|
>::type
|
||||||
storage_type;
|
storage_type;
|
||||||
|
|
||||||
storage_type temp;
|
storage_type temp;
|
||||||
Value * temp_ptr = reinterpret_cast<Value*>(temp.address());
|
Value * temp_ptr = reinterpret_cast<Value*>(temp.address());
|
||||||
|
|
||||||
@@ -1729,9 +1729,9 @@ private:
|
|||||||
void insert_dispatch(iterator position, Iterator first, Iterator last, boost::random_access_traversal_tag const&)
|
void insert_dispatch(iterator position, Iterator first, Iterator last, boost::random_access_traversal_tag const&)
|
||||||
{
|
{
|
||||||
//BOOST_CONCEPT_ASSERT((boost_concepts::RandomAccessTraversal<Iterator>)); // Make sure you passed a RandomAccessIterator
|
//BOOST_CONCEPT_ASSERT((boost_concepts::RandomAccessTraversal<Iterator>)); // Make sure you passed a RandomAccessIterator
|
||||||
|
|
||||||
errh::check_iterator_end_eq(*this, position);
|
errh::check_iterator_end_eq(*this, position);
|
||||||
|
|
||||||
typename boost::iterator_difference<Iterator>::type
|
typename boost::iterator_difference<Iterator>::type
|
||||||
count = std::distance(first, last);
|
count = std::distance(first, last);
|
||||||
|
|
||||||
@@ -1766,7 +1766,7 @@ private:
|
|||||||
|
|
||||||
std::ptrdiff_t d = std::distance(position, this->begin() + Capacity);
|
std::ptrdiff_t d = std::distance(position, this->begin() + Capacity);
|
||||||
std::size_t count = sv::uninitialized_copy_s(first, last, position, d); // may throw
|
std::size_t count = sv::uninitialized_copy_s(first, last, position, d); // may throw
|
||||||
|
|
||||||
errh::check_capacity(*this, count <= static_cast<std::size_t>(d) ? m_size + count : Capacity + 1); // may throw
|
errh::check_capacity(*this, count <= static_cast<std::size_t>(d) ? m_size + count : Capacity + 1); // may throw
|
||||||
|
|
||||||
m_size += count;
|
m_size += count;
|
||||||
@@ -1775,7 +1775,7 @@ private:
|
|||||||
{
|
{
|
||||||
typename boost::iterator_difference<Iterator>::type
|
typename boost::iterator_difference<Iterator>::type
|
||||||
count = std::distance(first, last);
|
count = std::distance(first, last);
|
||||||
|
|
||||||
errh::check_capacity(*this, m_size + count); // may throw
|
errh::check_capacity(*this, m_size + count); // may throw
|
||||||
|
|
||||||
this->insert_in_the_middle(position, first, last, count); // may throw
|
this->insert_in_the_middle(position, first, last, count); // may throw
|
||||||
@@ -1977,7 +1977,7 @@ public:
|
|||||||
errh::check_capacity(*this, count); // may throw
|
errh::check_capacity(*this, count); // may throw
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// nothrow
|
// nothrow
|
||||||
void reserve(size_type count)
|
void reserve(size_type count)
|
||||||
{
|
{
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
#include <boost/concept_check.hpp>
|
#include <boost/concept_check.hpp>
|
||||||
|
|
||||||
namespace boost { namespace container { namespace container_detail { namespace concept {
|
namespace boost { namespace container { namespace container_detail { namespace concept {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* VArrayStrategyConcept
|
* VArrayStrategyConcept
|
||||||
*
|
*
|
||||||
@@ -41,7 +41,7 @@ struct VArrayStrategy {
|
|||||||
|
|
||||||
// must implement allocate_failed
|
// must implement allocate_failed
|
||||||
str->allocate_failed();
|
str->allocate_failed();
|
||||||
|
|
||||||
boost::ignore_unused_variable_warning(str);
|
boost::ignore_unused_variable_warning(str);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -52,9 +52,9 @@ namespace boost { namespace container { namespace varray_detail {
|
|||||||
template <typename I>
|
template <typename I>
|
||||||
struct are_elements_contiguous : boost::is_pointer<I>
|
struct are_elements_contiguous : boost::is_pointer<I>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
#if defined(BOOST_CONTAINER_VARRAY_ENABLE_VECTORS_OPTIMIZATION) && !defined(BOOST_NO_EXCEPTIONS)
|
#if defined(BOOST_CONTAINER_VARRAY_ENABLE_VECTORS_OPTIMIZATION) && !defined(BOOST_NO_EXCEPTIONS)
|
||||||
|
|
||||||
template <typename Pointer>
|
template <typename Pointer>
|
||||||
struct are_elements_contiguous<
|
struct are_elements_contiguous<
|
||||||
boost::container::container_detail::vector_const_iterator<Pointer>
|
boost::container::container_detail::vector_const_iterator<Pointer>
|
||||||
@@ -68,7 +68,7 @@ struct are_elements_contiguous<
|
|||||||
{};
|
{};
|
||||||
|
|
||||||
#if defined(BOOST_DINKUMWARE_STDLIB)
|
#if defined(BOOST_DINKUMWARE_STDLIB)
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct are_elements_contiguous<
|
struct are_elements_contiguous<
|
||||||
std::_Vector_const_iterator<T>
|
std::_Vector_const_iterator<T>
|
||||||
@@ -101,7 +101,7 @@ struct are_elements_contiguous<
|
|||||||
#else // OTHER_STDLIB
|
#else // OTHER_STDLIB
|
||||||
|
|
||||||
// TODO - add other iterators implementations
|
// TODO - add other iterators implementations
|
||||||
|
|
||||||
#endif // STDLIB
|
#endif // STDLIB
|
||||||
|
|
||||||
#endif // BOOST_CONTAINER_VARRAY_ENABLE_VECTORS_OPTIMIZATION && !BOOST_NO_EXCEPTIONS
|
#endif // BOOST_CONTAINER_VARRAY_ENABLE_VECTORS_OPTIMIZATION && !BOOST_NO_EXCEPTIONS
|
||||||
@@ -212,7 +212,7 @@ inline O copy(I first, I last, O dst)
|
|||||||
>
|
>
|
||||||
>::type
|
>::type
|
||||||
use_memmove;
|
use_memmove;
|
||||||
|
|
||||||
return copy_dispatch(first, last, dst, use_memmove()); // may throw
|
return copy_dispatch(first, last, dst, use_memmove()); // may throw
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -32,12 +32,12 @@ namespace boost { namespace container {
|
|||||||
* change in size, along with the static allocation, low overhead, and fixed capacity of boost::array.
|
* change in size, along with the static allocation, low overhead, and fixed capacity of boost::array.
|
||||||
*
|
*
|
||||||
* A varray is a sequence that supports random access to elements, constant time insertion and
|
* A varray is a sequence that supports random access to elements, constant time insertion and
|
||||||
* removal of elements at the end, and linear time insertion and removal of elements at the beginning or
|
* removal of elements at the end, and linear time insertion and removal of elements at the beginning or
|
||||||
* in the middle. The number of elements in a varray may vary dynamically up to a fixed capacity
|
* in the middle. The number of elements in a varray may vary dynamically up to a fixed capacity
|
||||||
* because elements are stored within the object itself similarly to an array. However, objects are
|
* because elements are stored within the object itself similarly to an array. However, objects are
|
||||||
* initialized as they are inserted into varray unlike C arrays or std::array which must construct
|
* initialized as they are inserted into varray unlike C arrays or std::array which must construct
|
||||||
* all elements on instantiation. The behavior of varray enables the use of statically allocated
|
* all elements on instantiation. The behavior of varray enables the use of statically allocated
|
||||||
* elements in cases with complex object lifetime requirements that would otherwise not be trivially
|
* elements in cases with complex object lifetime requirements that would otherwise not be trivially
|
||||||
* possible.
|
* possible.
|
||||||
*
|
*
|
||||||
* @par Error Handling
|
* @par Error Handling
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# (C) Copyright Vladimir Prus, David Abrahams, Michael Stevens, Hartmut Kaiser,
|
# (C) Copyright Vladimir Prus, David Abrahams, Michael Stevens, Hartmut Kaiser,
|
||||||
# Ion Gaztanaga 2007-2008
|
# Ion Gaztanaga 2007-2008
|
||||||
# Use, modification and distribution are subject to the
|
# Use, modification and distribution are subject to the
|
||||||
# Boost Software License, Version 1.0. (See accompanying file
|
# Boost Software License, Version 1.0. (See accompanying file
|
||||||
|
@@ -61,22 +61,22 @@ boostbook standalone
|
|||||||
<format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/doc/html
|
<format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/doc/html
|
||||||
|
|
||||||
# Build requirements go here:
|
# Build requirements go here:
|
||||||
|
|
||||||
# <auto-index>on (or off) one turns on (or off) indexing:
|
# <auto-index>on (or off) one turns on (or off) indexing:
|
||||||
<auto-index>on
|
<auto-index>on
|
||||||
|
|
||||||
# Turns on (or off) auto-index-verbose for diagnostic info.
|
# Turns on (or off) auto-index-verbose for diagnostic info.
|
||||||
# This is highly recommended until you have got all the many details correct!
|
# This is highly recommended until you have got all the many details correct!
|
||||||
<auto-index-verbose>on
|
<auto-index-verbose>on
|
||||||
|
|
||||||
# Choose the indexing method (separately for html and PDF) - see manual.
|
# Choose the indexing method (separately for html and PDF) - see manual.
|
||||||
# Choose indexing method for PDFs:
|
# Choose indexing method for PDFs:
|
||||||
<format>pdf:<auto-index-internal>off
|
<format>pdf:<auto-index-internal>off
|
||||||
|
|
||||||
# Choose indexing method for html:
|
# Choose indexing method for html:
|
||||||
<format>html:<auto-index-internal>on
|
<format>html:<auto-index-internal>on
|
||||||
<format>docbook:<auto-index-internal>on
|
<format>docbook:<auto-index-internal>on
|
||||||
|
|
||||||
# Set the name of the script file to use (index.idx is popular):
|
# Set the name of the script file to use (index.idx is popular):
|
||||||
<auto-index-script>$(here)/index.idx
|
<auto-index-script>$(here)/index.idx
|
||||||
# Commands in the script file should all use RELATIVE PATHS
|
# Commands in the script file should all use RELATIVE PATHS
|
||||||
|
@@ -278,7 +278,7 @@ a throw-callback declared in [headerref boost/container/throw_exception.hpp]:
|
|||||||
* If `BOOST_CONTAINER_USER_DEFINED_THROW_CALLBACKS` is defined, then the programmer must provide its own definition for all
|
* If `BOOST_CONTAINER_USER_DEFINED_THROW_CALLBACKS` is defined, then the programmer must provide its own definition for all
|
||||||
`throw_xxx` functions. Those functions can't return, they must throw an exception or call `std::exit` or `std::abort`.
|
`throw_xxx` functions. Those functions can't return, they must throw an exception or call `std::exit` or `std::abort`.
|
||||||
* Else if `BOOST_NO_EXCEPTIONS` is defined, a `BOOST_ASSERT_MSG` assertion is triggered
|
* Else if `BOOST_NO_EXCEPTIONS` is defined, a `BOOST_ASSERT_MSG` assertion is triggered
|
||||||
(see [@http://www.boost.org/libs/utility/assert.html Boost.Assert] for more information).
|
(see [@http://www.boost.org/libs/utility/assert.html Boost.Assert] for more information).
|
||||||
If this assertion returns, then `std::abort` is called.
|
If this assertion returns, then `std::abort` is called.
|
||||||
* Else, an appropriate standard library exception is thrown (like `std::out_of_range`).
|
* Else, an appropriate standard library exception is thrown (like `std::out_of_range`).
|
||||||
|
|
||||||
@@ -487,27 +487,27 @@ complementary.
|
|||||||
|
|
||||||
[section:static_vector ['static_vector]]
|
[section:static_vector ['static_vector]]
|
||||||
|
|
||||||
`static_vector` is an hybrid between `vector` and `array`: like `vector`, it's a sequence container
|
`static_vector` is an hybrid between `vector` and `array`: like `vector`, it's a sequence container
|
||||||
with contiguous storage that can change in size, along with the static allocation, low overhead,
|
with contiguous storage that can change in size, along with the static allocation, low overhead,
|
||||||
and fixed capacity of `array`. `static_vector` is based on Adam Wulkiewicz and Andrew Hundt's
|
and fixed capacity of `array`. `static_vector` is based on Adam Wulkiewicz and Andrew Hundt's
|
||||||
high-performance [@https://svn.boost.org/svn/boost/sandbox/varray/doc/html/index.html varray]
|
high-performance [@https://svn.boost.org/svn/boost/sandbox/varray/doc/html/index.html varray]
|
||||||
class.
|
class.
|
||||||
|
|
||||||
The number of elements in a `static_vector` may vary dynamically up to a fixed capacity
|
The number of elements in a `static_vector` may vary dynamically up to a fixed capacity
|
||||||
because elements are stored within the object itself similarly to an array. However, objects are
|
because elements are stored within the object itself similarly to an array. However, objects are
|
||||||
initialized as they are inserted into `static_vector` unlike C arrays or `std::array` which must construct
|
initialized as they are inserted into `static_vector` unlike C arrays or `std::array` which must construct
|
||||||
all elements on instantiation. The behavior of `static_vector` enables the use of statically allocated
|
all elements on instantiation. The behavior of `static_vector` enables the use of statically allocated
|
||||||
elements in cases with complex object lifetime requirements that would otherwise not be trivially
|
elements in cases with complex object lifetime requirements that would otherwise not be trivially
|
||||||
possible. Some other properties:
|
possible. Some other properties:
|
||||||
|
|
||||||
* Random access to elements
|
* Random access to elements
|
||||||
* Constant time insertion and removal of elements at the end
|
* Constant time insertion and removal of elements at the end
|
||||||
* Linear time insertion and removal of elements at the beginning or in the middle.
|
* Linear time insertion and removal of elements at the beginning or in the middle.
|
||||||
|
|
||||||
`static_vector` is well suited for use in a buffer, the internal implementation of other
|
`static_vector` is well suited for use in a buffer, the internal implementation of other
|
||||||
classes, or use cases where there is a fixed limit to the number of elements that must be stored.
|
classes, or use cases where there is a fixed limit to the number of elements that must be stored.
|
||||||
Embedded and realtime applications where allocation either may not be available or acceptable
|
Embedded and realtime applications where allocation either may not be available or acceptable
|
||||||
are a particular case where `static_vector` can be beneficial.
|
are a particular case where `static_vector` can be beneficial.
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
|
||||||
@@ -535,13 +535,13 @@ using [@http://en.cppreference.com/w/cpp/language/default_initialization default
|
|||||||
|
|
||||||
[section:ordered_range_insertion Ordered range insertion for associative containers (['ordered_unique_range], ['ordered_range]) ]
|
[section:ordered_range_insertion Ordered range insertion for associative containers (['ordered_unique_range], ['ordered_range]) ]
|
||||||
|
|
||||||
When filling associative containers big performance gains can be achieved if the input range to be inserted
|
When filling associative containers big performance gains can be achieved if the input range to be inserted
|
||||||
is guaranteed by the user to be ordered according to the predicate. This can happen when inserting values from a `set` to
|
is guaranteed by the user to be ordered according to the predicate. This can happen when inserting values from a `set` to
|
||||||
a `multiset` or between different associative container families (`[multi]set/map` vs. `flat_[multi]set/map`).
|
a `multiset` or between different associative container families (`[multi]set/map` vs. `flat_[multi]set/map`).
|
||||||
|
|
||||||
[*Boost.Container] has some overloads for constructors and insertions taking an `ordered_unique_range_t` or
|
[*Boost.Container] has some overloads for constructors and insertions taking an `ordered_unique_range_t` or
|
||||||
an `ordered_range_t` tag parameters as the first argument. When an `ordered_unique_range_t` overload is used, the
|
an `ordered_range_t` tag parameters as the first argument. When an `ordered_unique_range_t` overload is used, the
|
||||||
user notifies the container that the input range is ordered according to the container predicate and has no
|
user notifies the container that the input range is ordered according to the container predicate and has no
|
||||||
duplicates. When an `ordered_range_t` overload is used, the
|
duplicates. When an `ordered_range_t` overload is used, the
|
||||||
user notifies the container that the input range is ordered according to the container predicate but it might
|
user notifies the container that the input range is ordered according to the container predicate but it might
|
||||||
have duplicates. With this information, the container can avoid multiple predicate calls and improve insertion
|
have duplicates. With this information, the container can avoid multiple predicate calls and improve insertion
|
||||||
@@ -592,7 +592,7 @@ used to customize these containers:
|
|||||||
[section:constant_time_range_splice Constant-time range splice for `(s)list`]
|
[section:constant_time_range_splice Constant-time range splice for `(s)list`]
|
||||||
|
|
||||||
In the first C++ standard `list::size()` was not required to be constant-time,
|
In the first C++ standard `list::size()` was not required to be constant-time,
|
||||||
and that caused some controversy in the C++ community. Quoting Howard Hinnant's
|
and that caused some controversy in the C++ community. Quoting Howard Hinnant's
|
||||||
[@http://home.roadrunner.com/~hinnant/On_list_size.html ['On List Size]] paper:
|
[@http://home.roadrunner.com/~hinnant/On_list_size.html ['On List Size]] paper:
|
||||||
|
|
||||||
[: ['There is a considerable debate on whether `std::list<T>::size()` should be O(1) or O(N).
|
[: ['There is a considerable debate on whether `std::list<T>::size()` should be O(1) or O(N).
|
||||||
@@ -603,7 +603,7 @@ The usual argument notes that it is a tradeoff with:]
|
|||||||
['If size() is O(1) and this != &x, then this method must perform a linear operation so that it
|
['If size() is O(1) and this != &x, then this method must perform a linear operation so that it
|
||||||
can adjust the size member in each list]]
|
can adjust the size member in each list]]
|
||||||
|
|
||||||
C++11 definitely required `size()` to be O(1), so range splice became O(N). However,
|
C++11 definitely required `size()` to be O(1), so range splice became O(N). However,
|
||||||
Howard Hinnant's paper proposed a new `splice` overload so that even O(1) `list:size()`
|
Howard Hinnant's paper proposed a new `splice` overload so that even O(1) `list:size()`
|
||||||
implementations could achieve O(1) range splice when the range size was known to the caller:
|
implementations could achieve O(1) range splice when the range size was known to the caller:
|
||||||
|
|
||||||
@@ -629,7 +629,7 @@ then the operation is constant time, even with an O(1) size.
|
|||||||
|
|
||||||
[section:extended_allocators Extended allocators]
|
[section:extended_allocators Extended allocators]
|
||||||
|
|
||||||
Many C++ programmers have ever wondered where does good old realloc fit in C++. And that's a good question.
|
Many C++ programmers have ever wondered where does good old realloc fit in C++. And that's a good question.
|
||||||
Could we improve [classref boost::container::vector vector] performance using memory expansion mechanisms
|
Could we improve [classref boost::container::vector vector] performance using memory expansion mechanisms
|
||||||
to avoid too many copies? But [classref boost::container::vector vector] is not the only container that
|
to avoid too many copies? But [classref boost::container::vector vector] is not the only container that
|
||||||
could benefit from an improved allocator interface: we could take advantage of the insertion of multiple
|
could benefit from an improved allocator interface: we could take advantage of the insertion of multiple
|
||||||
@@ -637,7 +637,7 @@ elements in [classref boost::container::list list] using a burst allocation mech
|
|||||||
costs (mutex locks, free memory searches...) that can't be amortized when using single node allocation
|
costs (mutex locks, free memory searches...) that can't be amortized when using single node allocation
|
||||||
strategies.
|
strategies.
|
||||||
|
|
||||||
These improvements require extending the STL allocator interface and use make use of a new
|
These improvements require extending the STL allocator interface and use make use of a new
|
||||||
general purpose allocator since new and delete don't offer expansion and burst capabilities.
|
general purpose allocator since new and delete don't offer expansion and burst capabilities.
|
||||||
|
|
||||||
* [*Boost.Container] containers support an extended allocator interface based on an evolution of proposals
|
* [*Boost.Container] containers support an extended allocator interface based on an evolution of proposals
|
||||||
@@ -803,7 +803,7 @@ versions.
|
|||||||
|
|
||||||
[classref ::boost::container::vector vector] does not support the strong exception guarantees
|
[classref ::boost::container::vector vector] does not support the strong exception guarantees
|
||||||
given by `std::vector` in functions like `insert`, `push_back`, `emplace`, `emplace_back`,
|
given by `std::vector` in functions like `insert`, `push_back`, `emplace`, `emplace_back`,
|
||||||
`resize`, `reserve` or `shrink_to_fit` for either copyable or no-throw moveable classes.
|
`resize`, `reserve` or `shrink_to_fit` for either copyable or no-throw moveable classes.
|
||||||
[@http://en.cppreference.com/w/cpp/utility/move_if_noexcept move_if_noexcept] is used to maintain
|
[@http://en.cppreference.com/w/cpp/utility/move_if_noexcept move_if_noexcept] is used to maintain
|
||||||
C++03 exception safety guarantees combined with C++11 move semantics.
|
C++03 exception safety guarantees combined with C++11 move semantics.
|
||||||
This strong exception guarantee degrades the insertion performance of copyable and throw moveable types,
|
This strong exception guarantee degrades the insertion performance of copyable and throw moveable types,
|
||||||
@@ -902,7 +902,7 @@ use [*Boost.Container]? There are several reasons for that:
|
|||||||
* Small string optimization for [classref boost::container::basic_string basic_string].
|
* Small string optimization for [classref boost::container::basic_string basic_string].
|
||||||
* [link container.extended_functionality Extended functionality] beyond the standard based
|
* [link container.extended_functionality Extended functionality] beyond the standard based
|
||||||
on user feedback to improve code performance.
|
on user feedback to improve code performance.
|
||||||
* You need a portable implementation that works when compiling without exceptions support or
|
* You need a portable implementation that works when compiling without exceptions support or
|
||||||
you need to customize the error handling when a container needs to signal an exceptional error.
|
you need to customize the error handling when a container needs to signal an exceptional error.
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@@ -1051,7 +1051,7 @@ use [*Boost.Container]? There are several reasons for that:
|
|||||||
[@https://svn.boost.org/trac/boost/ticket/6536 #6536],
|
[@https://svn.boost.org/trac/boost/ticket/6536 #6536],
|
||||||
[@https://svn.boost.org/trac/boost/ticket/6566 #6566],
|
[@https://svn.boost.org/trac/boost/ticket/6566 #6566],
|
||||||
[@https://svn.boost.org/trac/boost/ticket/6575 #6575],
|
[@https://svn.boost.org/trac/boost/ticket/6575 #6575],
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
|
||||||
|
|
||||||
|
@@ -53,7 +53,7 @@ int main ()
|
|||||||
avl_set_no_szopt.insert(1);
|
avl_set_no_szopt.insert(1);
|
||||||
avl_set_no_szopt.insert(1);
|
avl_set_no_szopt.insert(1);
|
||||||
assert(avl_set_no_szopt.count(1) == 1);
|
assert(avl_set_no_szopt.count(1) == 1);
|
||||||
|
|
||||||
SplayMultiset splay_mset;
|
SplayMultiset splay_mset;
|
||||||
splay_mset.insert(2);
|
splay_mset.insert(2);
|
||||||
splay_mset.insert(2);
|
splay_mset.insert(2);
|
||||||
|
@@ -111,11 +111,11 @@ class adaptive_pool
|
|||||||
<multiallocation_chain_void, T> multiallocation_chain;
|
<multiallocation_chain_void, T> multiallocation_chain;
|
||||||
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
||||||
|
|
||||||
//!Obtains adaptive_pool from
|
//!Obtains adaptive_pool from
|
||||||
//!adaptive_pool
|
//!adaptive_pool
|
||||||
template<class T2>
|
template<class T2>
|
||||||
struct rebind
|
struct rebind
|
||||||
{
|
{
|
||||||
typedef adaptive_pool
|
typedef adaptive_pool
|
||||||
< T2
|
< T2
|
||||||
, NodesPerBlock
|
, NodesPerBlock
|
||||||
@@ -166,7 +166,7 @@ class adaptive_pool
|
|||||||
size_type max_size() const BOOST_CONTAINER_NOEXCEPT
|
size_type max_size() const BOOST_CONTAINER_NOEXCEPT
|
||||||
{ return size_type(-1)/sizeof(T); }
|
{ return size_type(-1)/sizeof(T); }
|
||||||
|
|
||||||
//!Allocate memory for an array of count elements.
|
//!Allocate memory for an array of count elements.
|
||||||
//!Throws std::bad_alloc if there is no enough memory
|
//!Throws std::bad_alloc if there is no enough memory
|
||||||
pointer allocate(size_type count, const void * = 0)
|
pointer allocate(size_type count, const void * = 0)
|
||||||
{
|
{
|
||||||
@@ -202,7 +202,7 @@ class adaptive_pool
|
|||||||
|
|
||||||
std::pair<pointer, bool>
|
std::pair<pointer, bool>
|
||||||
allocation_command(allocation_type command,
|
allocation_command(allocation_type command,
|
||||||
size_type limit_size,
|
size_type limit_size,
|
||||||
size_type preferred_size,
|
size_type preferred_size,
|
||||||
size_type &received_size, pointer reuse = pointer())
|
size_type &received_size, pointer reuse = pointer())
|
||||||
{
|
{
|
||||||
@@ -264,7 +264,7 @@ class adaptive_pool
|
|||||||
singleton_t::instance().deallocate_nodes(chain);
|
singleton_t::instance().deallocate_nodes(chain);
|
||||||
}
|
}
|
||||||
|
|
||||||
//!Allocates many elements of size elem_size.
|
//!Allocates many elements of size elem_size.
|
||||||
//!Elements must be individually deallocated with deallocate()
|
//!Elements must be individually deallocated with deallocate()
|
||||||
void allocate_many(size_type elem_size, std::size_t n_elements, multiallocation_chain &chain)
|
void allocate_many(size_type elem_size, std::size_t n_elements, multiallocation_chain &chain)
|
||||||
{
|
{
|
||||||
@@ -276,14 +276,14 @@ class adaptive_pool
|
|||||||
}
|
}
|
||||||
chain.incorporate_after(chain.before_begin()
|
chain.incorporate_after(chain.before_begin()
|
||||||
,(T*)BOOST_CONTAINER_MEMCHAIN_FIRSTMEM(&ch)
|
,(T*)BOOST_CONTAINER_MEMCHAIN_FIRSTMEM(&ch)
|
||||||
,(T*)BOOST_CONTAINER_MEMCHAIN_LASTMEM(&ch)
|
,(T*)BOOST_CONTAINER_MEMCHAIN_LASTMEM(&ch)
|
||||||
,BOOST_CONTAINER_MEMCHAIN_SIZE(&ch) );*/
|
,BOOST_CONTAINER_MEMCHAIN_SIZE(&ch) );*/
|
||||||
if(!boost_cont_multialloc_nodes(n_elements, elem_size*sizeof(T), DL_MULTIALLOC_DEFAULT_CONTIGUOUS, reinterpret_cast<boost_cont_memchain *>(&chain))){
|
if(!boost_cont_multialloc_nodes(n_elements, elem_size*sizeof(T), DL_MULTIALLOC_DEFAULT_CONTIGUOUS, reinterpret_cast<boost_cont_memchain *>(&chain))){
|
||||||
boost::container::throw_bad_alloc();
|
boost::container::throw_bad_alloc();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//!Allocates n_elements elements, each one of size elem_sizes[i]
|
//!Allocates n_elements elements, each one of size elem_sizes[i]
|
||||||
//!Elements must be individually deallocated with deallocate()
|
//!Elements must be individually deallocated with deallocate()
|
||||||
void allocate_many(const size_type *elem_sizes, size_type n_elements, multiallocation_chain &chain)
|
void allocate_many(const size_type *elem_sizes, size_type n_elements, multiallocation_chain &chain)
|
||||||
{
|
{
|
||||||
@@ -337,7 +337,7 @@ class adaptive_pool
|
|||||||
{ return false; }
|
{ return false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::pair<pointer, bool> priv_allocation_command
|
std::pair<pointer, bool> priv_allocation_command
|
||||||
(allocation_type command, std::size_t limit_size
|
(allocation_type command, std::size_t limit_size
|
||||||
,std::size_t preferred_size,std::size_t &received_size, void *reuse_ptr)
|
,std::size_t preferred_size,std::size_t &received_size, void *reuse_ptr)
|
||||||
{
|
{
|
||||||
|
@@ -57,7 +57,7 @@ class allocator<void, Version, AllocationDisableMask>
|
|||||||
//!objects of type T2
|
//!objects of type T2
|
||||||
template<class T2>
|
template<class T2>
|
||||||
struct rebind
|
struct rebind
|
||||||
{
|
{
|
||||||
typedef allocator< T2
|
typedef allocator< T2
|
||||||
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
||||||
, Version, AllocationDisableMask
|
, Version, AllocationDisableMask
|
||||||
@@ -78,7 +78,7 @@ class allocator<void, Version, AllocationDisableMask>
|
|||||||
//!Constructor from related allocator.
|
//!Constructor from related allocator.
|
||||||
//!Never throws
|
//!Never throws
|
||||||
template<class T2>
|
template<class T2>
|
||||||
allocator(const allocator<T2, Version, AllocationDisableMask> &)
|
allocator(const allocator<T2, Version, AllocationDisableMask> &)
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ template<class T>
|
|||||||
//! of allocation types the user wants to disable.
|
//! of allocation types the user wants to disable.
|
||||||
template<class T, unsigned Version, unsigned int AllocationDisableMask>
|
template<class T, unsigned Version, unsigned int AllocationDisableMask>
|
||||||
#endif //#ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
|
#endif //#ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
|
||||||
class allocator
|
class allocator
|
||||||
{
|
{
|
||||||
typedef unsigned int allocation_type;
|
typedef unsigned int allocation_type;
|
||||||
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
||||||
@@ -115,7 +115,7 @@ class allocator
|
|||||||
//Not assignable from other allocator
|
//Not assignable from other allocator
|
||||||
allocator& operator=(const allocator&);
|
allocator& operator=(const allocator&);
|
||||||
|
|
||||||
static const unsigned int ForbiddenMask =
|
static const unsigned int ForbiddenMask =
|
||||||
BOOST_CONTAINER_ALLOCATE_NEW | BOOST_CONTAINER_EXPAND_BWD | BOOST_CONTAINER_EXPAND_FWD ;
|
BOOST_CONTAINER_ALLOCATE_NEW | BOOST_CONTAINER_EXPAND_BWD | BOOST_CONTAINER_EXPAND_FWD ;
|
||||||
|
|
||||||
//The mask can't disable all the allocation types
|
//The mask can't disable all the allocation types
|
||||||
@@ -151,7 +151,7 @@ class allocator
|
|||||||
//!objects of type T2
|
//!objects of type T2
|
||||||
template<class T2>
|
template<class T2>
|
||||||
struct rebind
|
struct rebind
|
||||||
{
|
{
|
||||||
typedef allocator<T2, Version, AllocationDisableMask> other;
|
typedef allocator<T2, Version, AllocationDisableMask> other;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -175,7 +175,7 @@ class allocator
|
|||||||
> &) BOOST_CONTAINER_NOEXCEPT
|
> &) BOOST_CONTAINER_NOEXCEPT
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//!Allocates memory for an array of count elements.
|
//!Allocates memory for an array of count elements.
|
||||||
//!Throws std::bad_alloc if there is no enough memory
|
//!Throws std::bad_alloc if there is no enough memory
|
||||||
//!If Version is 2, this allocated memory can only be deallocated
|
//!If Version is 2, this allocated memory can only be deallocated
|
||||||
//!with deallocate() or (for Version == 2) deallocate_many()
|
//!with deallocate() or (for Version == 2) deallocate_many()
|
||||||
@@ -221,7 +221,7 @@ class allocator
|
|||||||
//!This function is available only with Version == 2
|
//!This function is available only with Version == 2
|
||||||
std::pair<pointer, bool>
|
std::pair<pointer, bool>
|
||||||
allocation_command(allocation_type command,
|
allocation_command(allocation_type command,
|
||||||
size_type limit_size,
|
size_type limit_size,
|
||||||
size_type preferred_size,
|
size_type preferred_size,
|
||||||
size_type &received_size, pointer reuse = pointer())
|
size_type &received_size, pointer reuse = pointer())
|
||||||
{
|
{
|
||||||
@@ -283,7 +283,7 @@ class allocator
|
|||||||
return this->deallocate_many(chain);
|
return this->deallocate_many(chain);
|
||||||
}
|
}
|
||||||
|
|
||||||
//!Allocates many elements of size elem_size.
|
//!Allocates many elements of size elem_size.
|
||||||
//!Elements must be individually deallocated with deallocate()
|
//!Elements must be individually deallocated with deallocate()
|
||||||
//!This function is available only with Version == 2
|
//!This function is available only with Version == 2
|
||||||
void allocate_many(size_type elem_size, std::size_t n_elements, multiallocation_chain &chain)
|
void allocate_many(size_type elem_size, std::size_t n_elements, multiallocation_chain &chain)
|
||||||
@@ -303,7 +303,7 @@ class allocator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//!Allocates n_elements elements, each one of size elem_sizes[i]
|
//!Allocates n_elements elements, each one of size elem_sizes[i]
|
||||||
//!Elements must be individually deallocated with deallocate()
|
//!Elements must be individually deallocated with deallocate()
|
||||||
//!This function is available only with Version == 2
|
//!This function is available only with Version == 2
|
||||||
void allocate_many(const size_type *elem_sizes, size_type n_elements, multiallocation_chain &chain)
|
void allocate_many(const size_type *elem_sizes, size_type n_elements, multiallocation_chain &chain)
|
||||||
@@ -340,7 +340,7 @@ class allocator
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
std::pair<pointer, bool> priv_allocation_command
|
std::pair<pointer, bool> priv_allocation_command
|
||||||
(allocation_type command, std::size_t limit_size
|
(allocation_type command, std::size_t limit_size
|
||||||
,std::size_t preferred_size,std::size_t &received_size, void *reuse_ptr)
|
,std::size_t preferred_size,std::size_t &received_size, void *reuse_ptr)
|
||||||
{
|
{
|
||||||
|
@@ -316,8 +316,8 @@ struct allocator_traits
|
|||||||
|
|
||||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||||
template<class T, class ...Args>
|
template<class T, class ...Args>
|
||||||
static void priv_construct(boost::false_type, Alloc &a, T *p, BOOST_FWD_REF(Args) ...args)
|
static void priv_construct(boost::false_type, Alloc &a, T *p, BOOST_FWD_REF(Args) ...args)
|
||||||
{
|
{
|
||||||
const bool value = boost::container::container_detail::
|
const bool value = boost::container::container_detail::
|
||||||
has_member_function_callable_with_construct
|
has_member_function_callable_with_construct
|
||||||
< Alloc, T*, Args... >::value;
|
< Alloc, T*, Args... >::value;
|
||||||
@@ -352,7 +352,7 @@ struct allocator_traits
|
|||||||
//
|
//
|
||||||
#define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
|
#define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
|
||||||
#include BOOST_PP_LOCAL_ITERATE()
|
#include BOOST_PP_LOCAL_ITERATE()
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#define BOOST_PP_LOCAL_MACRO(n) \
|
#define BOOST_PP_LOCAL_MACRO(n) \
|
||||||
template<class T BOOST_PP_ENUM_TRAILING_PARAMS(n, class P) > \
|
template<class T BOOST_PP_ENUM_TRAILING_PARAMS(n, class P) > \
|
||||||
|
@@ -93,9 +93,9 @@ namespace container_detail {
|
|||||||
// [start.cur, start.last) and [finish.first, finish.cur) are initialized
|
// [start.cur, start.last) and [finish.first, finish.cur) are initialized
|
||||||
// objects, and [start.first, start.cur) and [finish.cur, finish.last)
|
// objects, and [start.first, start.cur) and [finish.cur, finish.last)
|
||||||
// are uninitialized storage.
|
// are uninitialized storage.
|
||||||
// [map, map + map_size) is a valid, non-empty range.
|
// [map, map + map_size) is a valid, non-empty range.
|
||||||
// [start.node, finish.node] is a valid range contained within
|
// [start.node, finish.node] is a valid range contained within
|
||||||
// [map, map + map_size).
|
// [map, map + map_size).
|
||||||
// Allocator pointer in the range [map, map + map_size) points to an allocated node
|
// Allocator pointer in the range [map, map + map_size) points to an allocated node
|
||||||
// if and only if the pointer is in the range [start.node, finish.node].
|
// if and only if the pointer is in the range [start.node, finish.node].
|
||||||
template<class Pointer, bool IsConst>
|
template<class Pointer, bool IsConst>
|
||||||
@@ -122,7 +122,7 @@ class deque_iterator
|
|||||||
|
|
||||||
typedef Pointer val_alloc_ptr;
|
typedef Pointer val_alloc_ptr;
|
||||||
typedef typename boost::intrusive::pointer_traits<Pointer>::
|
typedef typename boost::intrusive::pointer_traits<Pointer>::
|
||||||
template rebind_pointer<Pointer>::type index_pointer;
|
template rebind_pointer<Pointer>::type index_pointer;
|
||||||
|
|
||||||
Pointer m_cur;
|
Pointer m_cur;
|
||||||
Pointer m_first;
|
Pointer m_first;
|
||||||
@@ -227,7 +227,7 @@ class deque_iterator
|
|||||||
|
|
||||||
deque_iterator& operator-=(difference_type n) BOOST_CONTAINER_NOEXCEPT
|
deque_iterator& operator-=(difference_type n) BOOST_CONTAINER_NOEXCEPT
|
||||||
{ return *this += -n; }
|
{ return *this += -n; }
|
||||||
|
|
||||||
deque_iterator operator-(difference_type n) const BOOST_CONTAINER_NOEXCEPT
|
deque_iterator operator-(difference_type n) const BOOST_CONTAINER_NOEXCEPT
|
||||||
{ deque_iterator tmp(*this); return tmp -= n; }
|
{ deque_iterator tmp(*this); return tmp -= n; }
|
||||||
|
|
||||||
@@ -343,7 +343,7 @@ class deque_base
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
deque_base(const deque_base&);
|
deque_base(const deque_base&);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
void swap_members(deque_base &x) BOOST_CONTAINER_NOEXCEPT
|
void swap_members(deque_base &x) BOOST_CONTAINER_NOEXCEPT
|
||||||
@@ -364,7 +364,7 @@ class deque_base
|
|||||||
|
|
||||||
ptr_alloc_ptr nstart = this->members_.m_map + (this->members_.m_map_size - num_nodes) / 2;
|
ptr_alloc_ptr nstart = this->members_.m_map + (this->members_.m_map_size - num_nodes) / 2;
|
||||||
ptr_alloc_ptr nfinish = nstart + num_nodes;
|
ptr_alloc_ptr nfinish = nstart + num_nodes;
|
||||||
|
|
||||||
BOOST_TRY {
|
BOOST_TRY {
|
||||||
this->priv_create_nodes(nstart, nfinish);
|
this->priv_create_nodes(nstart, nfinish);
|
||||||
}
|
}
|
||||||
@@ -451,13 +451,13 @@ class deque_base
|
|||||||
|
|
||||||
ptr_alloc_t &ptr_alloc() BOOST_CONTAINER_NOEXCEPT
|
ptr_alloc_t &ptr_alloc() BOOST_CONTAINER_NOEXCEPT
|
||||||
{ return members_; }
|
{ return members_; }
|
||||||
|
|
||||||
const ptr_alloc_t &ptr_alloc() const BOOST_CONTAINER_NOEXCEPT
|
const ptr_alloc_t &ptr_alloc() const BOOST_CONTAINER_NOEXCEPT
|
||||||
{ return members_; }
|
{ return members_; }
|
||||||
|
|
||||||
allocator_type &alloc() BOOST_CONTAINER_NOEXCEPT
|
allocator_type &alloc() BOOST_CONTAINER_NOEXCEPT
|
||||||
{ return members_; }
|
{ return members_; }
|
||||||
|
|
||||||
const allocator_type &alloc() const BOOST_CONTAINER_NOEXCEPT
|
const allocator_type &alloc() const BOOST_CONTAINER_NOEXCEPT
|
||||||
{ return members_; }
|
{ return members_; }
|
||||||
};
|
};
|
||||||
@@ -1896,7 +1896,7 @@ class deque : protected deque_base<Allocator>
|
|||||||
this->priv_deallocate_node(this->members_.m_start.m_first);
|
this->priv_deallocate_node(this->members_.m_start.m_first);
|
||||||
this->members_.m_start.priv_set_node(this->members_.m_start.m_node + 1);
|
this->members_.m_start.priv_set_node(this->members_.m_start.m_node + 1);
|
||||||
this->members_.m_start.m_cur = this->members_.m_start.m_first;
|
this->members_.m_start.m_cur = this->members_.m_start.m_first;
|
||||||
}
|
}
|
||||||
|
|
||||||
iterator priv_reserve_elements_at_front(size_type n)
|
iterator priv_reserve_elements_at_front(size_type n)
|
||||||
{
|
{
|
||||||
@@ -1916,7 +1916,7 @@ class deque : protected deque_base<Allocator>
|
|||||||
}
|
}
|
||||||
BOOST_CATCH(...) {
|
BOOST_CATCH(...) {
|
||||||
for (size_type j = 1; j < i; ++j)
|
for (size_type j = 1; j < i; ++j)
|
||||||
this->priv_deallocate_node(*(this->members_.m_start.m_node - j));
|
this->priv_deallocate_node(*(this->members_.m_start.m_node - j));
|
||||||
BOOST_RETHROW
|
BOOST_RETHROW
|
||||||
}
|
}
|
||||||
BOOST_CATCH_END
|
BOOST_CATCH_END
|
||||||
@@ -1941,7 +1941,7 @@ class deque : protected deque_base<Allocator>
|
|||||||
}
|
}
|
||||||
BOOST_CATCH(...) {
|
BOOST_CATCH(...) {
|
||||||
for (size_type j = 1; j < i; ++j)
|
for (size_type j = 1; j < i; ++j)
|
||||||
this->priv_deallocate_node(*(this->members_.m_finish.m_node + j));
|
this->priv_deallocate_node(*(this->members_.m_finish.m_node + j));
|
||||||
BOOST_RETHROW
|
BOOST_RETHROW
|
||||||
}
|
}
|
||||||
BOOST_CATCH_END
|
BOOST_CATCH_END
|
||||||
|
@@ -42,12 +42,12 @@ struct select_private_adaptive_node_pool_impl
|
|||||||
private_adaptive_node_pool_impl
|
private_adaptive_node_pool_impl
|
||||||
< fake_segment_manager
|
< fake_segment_manager
|
||||||
, unsigned(AlignOnly)*::boost::container::adaptive_pool_flag::align_only
|
, unsigned(AlignOnly)*::boost::container::adaptive_pool_flag::align_only
|
||||||
| ::boost::container::adaptive_pool_flag::size_ordered | ::boost::container::adaptive_pool_flag::address_ordered
|
| ::boost::container::adaptive_pool_flag::size_ordered | ::boost::container::adaptive_pool_flag::address_ordered
|
||||||
> type;
|
> type;
|
||||||
};
|
};
|
||||||
|
|
||||||
//!Pooled memory allocator using an smart adaptive pool. Includes
|
//!Pooled memory allocator using an smart adaptive pool. Includes
|
||||||
//!a reference count but the class does not delete itself, this is
|
//!a reference count but the class does not delete itself, this is
|
||||||
//!responsibility of user classes. Node size (NodeSize) and the number of
|
//!responsibility of user classes. Node size (NodeSize) and the number of
|
||||||
//!nodes allocated per block (NodesPerBlock) are known at compile time.
|
//!nodes allocated per block (NodesPerBlock) are known at compile time.
|
||||||
template< std::size_t NodeSize
|
template< std::size_t NodeSize
|
||||||
@@ -78,7 +78,7 @@ class private_adaptive_node_pool
|
|||||||
};
|
};
|
||||||
|
|
||||||
//!Pooled memory allocator using adaptive pool. Includes
|
//!Pooled memory allocator using adaptive pool. Includes
|
||||||
//!a reference count but the class does not delete itself, this is
|
//!a reference count but the class does not delete itself, this is
|
||||||
//!responsibility of user classes. Node size (NodeSize) and the number of
|
//!responsibility of user classes. Node size (NodeSize) and the number of
|
||||||
//!nodes allocated per block (NodesPerBlock) are known at compile time
|
//!nodes allocated per block (NodesPerBlock) are known at compile time
|
||||||
template< std::size_t NodeSize
|
template< std::size_t NodeSize
|
||||||
@@ -86,8 +86,8 @@ template< std::size_t NodeSize
|
|||||||
, std::size_t MaxFreeBlocks
|
, std::size_t MaxFreeBlocks
|
||||||
, std::size_t OverheadPercent
|
, std::size_t OverheadPercent
|
||||||
>
|
>
|
||||||
class shared_adaptive_node_pool
|
class shared_adaptive_node_pool
|
||||||
: public private_adaptive_node_pool
|
: public private_adaptive_node_pool
|
||||||
<NodeSize, NodesPerBlock, MaxFreeBlocks, OverheadPercent>
|
<NodeSize, NodesPerBlock, MaxFreeBlocks, OverheadPercent>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
@@ -112,7 +112,7 @@ class shared_adaptive_node_pool
|
|||||||
//-----------------------
|
//-----------------------
|
||||||
return private_node_allocator_t::allocate_node();
|
return private_node_allocator_t::allocate_node();
|
||||||
}
|
}
|
||||||
|
|
||||||
//!Deallocates an array pointed by ptr. Never throws
|
//!Deallocates an array pointed by ptr. Never throws
|
||||||
void deallocate_node(void *ptr)
|
void deallocate_node(void *ptr)
|
||||||
{
|
{
|
||||||
|
@@ -639,7 +639,7 @@ class private_adaptive_node_pool_impl
|
|||||||
|
|
||||||
{ //We iterate through the block tree to free the memory
|
{ //We iterate through the block tree to free the memory
|
||||||
const_block_iterator it(m_block_container.begin());
|
const_block_iterator it(m_block_container.begin());
|
||||||
|
|
||||||
if(it != itend){
|
if(it != itend){
|
||||||
for(++it; it != itend; ++it){
|
for(++it; it != itend; ++it){
|
||||||
const_block_iterator prev(it);
|
const_block_iterator prev(it);
|
||||||
|
@@ -277,7 +277,7 @@ BOOST_CONTAINER_DECL int boost_cont_malloc_check();
|
|||||||
typedef unsigned int allocation_type;
|
typedef unsigned int allocation_type;
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
// constants for allocation commands
|
// constants for allocation commands
|
||||||
BOOST_CONTAINER_ALLOCATE_NEW = 0X01,
|
BOOST_CONTAINER_ALLOCATE_NEW = 0X01,
|
||||||
BOOST_CONTAINER_EXPAND_FWD = 0X02,
|
BOOST_CONTAINER_EXPAND_FWD = 0X02,
|
||||||
|
@@ -23,7 +23,7 @@ namespace container {
|
|||||||
|
|
||||||
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
||||||
enum allocation_type_v
|
enum allocation_type_v
|
||||||
{
|
{
|
||||||
// constants for allocation commands
|
// constants for allocation commands
|
||||||
allocate_new_v = 0x01,
|
allocate_new_v = 0x01,
|
||||||
expand_fwd_v = 0x02,
|
expand_fwd_v = 0x02,
|
||||||
|
@@ -12,11 +12,11 @@
|
|||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
# pragma once
|
# pragma once
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// Automatically link to the correct build variant where possible.
|
// Automatically link to the correct build variant where possible.
|
||||||
//
|
//
|
||||||
#if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_CONTAINER_NO_LIB) && !defined(BOOST_CONTAINER_SOURCE)
|
#if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_CONTAINER_NO_LIB) && !defined(BOOST_CONTAINER_SOURCE)
|
||||||
//
|
//
|
||||||
// Set the name of our library, this will get undef'ed by auto_link.hpp
|
// Set the name of our library, this will get undef'ed by auto_link.hpp
|
||||||
|
@@ -198,7 +198,7 @@ struct scoped_destructor_n
|
|||||||
|
|
||||||
void shrink_forward(size_type inc)
|
void shrink_forward(size_type inc)
|
||||||
{ m_n -= inc; m_p += inc; }
|
{ m_n -= inc; m_p += inc; }
|
||||||
|
|
||||||
~scoped_destructor_n()
|
~scoped_destructor_n()
|
||||||
{
|
{
|
||||||
if(!m_p) return;
|
if(!m_p) return;
|
||||||
|
@@ -51,7 +51,7 @@ class flat_tree_value_compare
|
|||||||
typedef Value first_argument_type;
|
typedef Value first_argument_type;
|
||||||
typedef Value second_argument_type;
|
typedef Value second_argument_type;
|
||||||
typedef bool return_type;
|
typedef bool return_type;
|
||||||
public:
|
public:
|
||||||
flat_tree_value_compare()
|
flat_tree_value_compare()
|
||||||
: Compare()
|
: Compare()
|
||||||
{}
|
{}
|
||||||
@@ -68,7 +68,7 @@ class flat_tree_value_compare
|
|||||||
|
|
||||||
const Compare &get_comp() const
|
const Compare &get_comp() const
|
||||||
{ return *this; }
|
{ return *this; }
|
||||||
|
|
||||||
Compare &get_comp()
|
Compare &get_comp()
|
||||||
{ return *this; }
|
{ return *this; }
|
||||||
};
|
};
|
||||||
@@ -265,7 +265,7 @@ class flat_tree
|
|||||||
flat_tree& operator=(BOOST_RV_REF(flat_tree) mx)
|
flat_tree& operator=(BOOST_RV_REF(flat_tree) mx)
|
||||||
{ m_data = boost::move(mx.m_data); return *this; }
|
{ m_data = boost::move(mx.m_data); return *this; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// accessors:
|
// accessors:
|
||||||
Compare key_comp() const
|
Compare key_comp() const
|
||||||
{ return this->m_data.get_comp(); }
|
{ return this->m_data.get_comp(); }
|
||||||
@@ -728,8 +728,8 @@ class flat_tree
|
|||||||
{
|
{
|
||||||
iterator i = this->lower_bound(k);
|
iterator i = this->lower_bound(k);
|
||||||
iterator end_it = this->end();
|
iterator end_it = this->end();
|
||||||
if (i != end_it && this->m_data.get_comp()(k, KeyOfValue()(*i))){
|
if (i != end_it && this->m_data.get_comp()(k, KeyOfValue()(*i))){
|
||||||
i = end_it;
|
i = end_it;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@@ -739,7 +739,7 @@ class flat_tree
|
|||||||
const_iterator i = this->lower_bound(k);
|
const_iterator i = this->lower_bound(k);
|
||||||
|
|
||||||
const_iterator end_it = this->cend();
|
const_iterator end_it = this->cend();
|
||||||
if (i != end_it && this->m_data.get_comp()(k, KeyOfValue()(*i))){
|
if (i != end_it && this->m_data.get_comp()(k, KeyOfValue()(*i))){
|
||||||
i = end_it;
|
i = end_it;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
@@ -777,10 +777,10 @@ class flat_tree
|
|||||||
std::pair<const_iterator, const_iterator> lower_bound_range(const key_type& k) const
|
std::pair<const_iterator, const_iterator> lower_bound_range(const key_type& k) const
|
||||||
{ return this->priv_lower_bound_range(this->cbegin(), this->cend(), k); }
|
{ return this->priv_lower_bound_range(this->cbegin(), this->cend(), k); }
|
||||||
|
|
||||||
size_type capacity() const
|
size_type capacity() const
|
||||||
{ return this->m_data.m_vect.capacity(); }
|
{ return this->m_data.m_vect.capacity(); }
|
||||||
|
|
||||||
void reserve(size_type cnt)
|
void reserve(size_type cnt)
|
||||||
{ this->m_data.m_vect.reserve(cnt); }
|
{ this->m_data.m_vect.reserve(cnt); }
|
||||||
|
|
||||||
friend bool operator==(const flat_tree& x, const flat_tree& y)
|
friend bool operator==(const flat_tree& x, const flat_tree& y)
|
||||||
|
@@ -53,7 +53,7 @@ class constant_iterator
|
|||||||
|
|
||||||
constant_iterator& operator++()
|
constant_iterator& operator++()
|
||||||
{ increment(); return *this; }
|
{ increment(); return *this; }
|
||||||
|
|
||||||
constant_iterator operator++(int)
|
constant_iterator operator++(int)
|
||||||
{
|
{
|
||||||
constant_iterator result (*this);
|
constant_iterator result (*this);
|
||||||
@@ -63,7 +63,7 @@ class constant_iterator
|
|||||||
|
|
||||||
constant_iterator& operator--()
|
constant_iterator& operator--()
|
||||||
{ decrement(); return *this; }
|
{ decrement(); return *this; }
|
||||||
|
|
||||||
constant_iterator operator--(int)
|
constant_iterator operator--(int)
|
||||||
{
|
{
|
||||||
constant_iterator result (*this);
|
constant_iterator result (*this);
|
||||||
@@ -164,7 +164,7 @@ class value_init_construct_iterator
|
|||||||
|
|
||||||
value_init_construct_iterator& operator++()
|
value_init_construct_iterator& operator++()
|
||||||
{ increment(); return *this; }
|
{ increment(); return *this; }
|
||||||
|
|
||||||
value_init_construct_iterator operator++(int)
|
value_init_construct_iterator operator++(int)
|
||||||
{
|
{
|
||||||
value_init_construct_iterator result (*this);
|
value_init_construct_iterator result (*this);
|
||||||
@@ -174,7 +174,7 @@ class value_init_construct_iterator
|
|||||||
|
|
||||||
value_init_construct_iterator& operator--()
|
value_init_construct_iterator& operator--()
|
||||||
{ decrement(); return *this; }
|
{ decrement(); return *this; }
|
||||||
|
|
||||||
value_init_construct_iterator operator--(int)
|
value_init_construct_iterator operator--(int)
|
||||||
{
|
{
|
||||||
value_init_construct_iterator result (*this);
|
value_init_construct_iterator result (*this);
|
||||||
@@ -275,7 +275,7 @@ class default_init_construct_iterator
|
|||||||
|
|
||||||
default_init_construct_iterator& operator++()
|
default_init_construct_iterator& operator++()
|
||||||
{ increment(); return *this; }
|
{ increment(); return *this; }
|
||||||
|
|
||||||
default_init_construct_iterator operator++(int)
|
default_init_construct_iterator operator++(int)
|
||||||
{
|
{
|
||||||
default_init_construct_iterator result (*this);
|
default_init_construct_iterator result (*this);
|
||||||
@@ -285,7 +285,7 @@ class default_init_construct_iterator
|
|||||||
|
|
||||||
default_init_construct_iterator& operator--()
|
default_init_construct_iterator& operator--()
|
||||||
{ decrement(); return *this; }
|
{ decrement(); return *this; }
|
||||||
|
|
||||||
default_init_construct_iterator operator--(int)
|
default_init_construct_iterator operator--(int)
|
||||||
{
|
{
|
||||||
default_init_construct_iterator result (*this);
|
default_init_construct_iterator result (*this);
|
||||||
@@ -386,7 +386,7 @@ class repeat_iterator
|
|||||||
|
|
||||||
this_type& operator++()
|
this_type& operator++()
|
||||||
{ increment(); return *this; }
|
{ increment(); return *this; }
|
||||||
|
|
||||||
this_type operator++(int)
|
this_type operator++(int)
|
||||||
{
|
{
|
||||||
this_type result (*this);
|
this_type result (*this);
|
||||||
@@ -396,7 +396,7 @@ class repeat_iterator
|
|||||||
|
|
||||||
this_type& operator--()
|
this_type& operator--()
|
||||||
{ increment(); return *this; }
|
{ increment(); return *this; }
|
||||||
|
|
||||||
this_type operator--(int)
|
this_type operator--(int)
|
||||||
{
|
{
|
||||||
this_type result (*this);
|
this_type result (*this);
|
||||||
@@ -497,7 +497,7 @@ class emplace_iterator
|
|||||||
|
|
||||||
this_type& operator++()
|
this_type& operator++()
|
||||||
{ increment(); return *this; }
|
{ increment(); return *this; }
|
||||||
|
|
||||||
this_type operator++(int)
|
this_type operator++(int)
|
||||||
{
|
{
|
||||||
this_type result (*this);
|
this_type result (*this);
|
||||||
@@ -507,7 +507,7 @@ class emplace_iterator
|
|||||||
|
|
||||||
this_type& operator--()
|
this_type& operator--()
|
||||||
{ decrement(); return *this; }
|
{ decrement(); return *this; }
|
||||||
|
|
||||||
this_type operator--(int)
|
this_type operator--(int)
|
||||||
{
|
{
|
||||||
this_type result (*this);
|
this_type result (*this);
|
||||||
|
@@ -96,7 +96,7 @@ inline std::size_t floor_log2 (std::size_t x)
|
|||||||
|
|
||||||
std::size_t n = x;
|
std::size_t n = x;
|
||||||
std::size_t log2 = 0;
|
std::size_t log2 = 0;
|
||||||
|
|
||||||
for(std::size_t shift = Bits >> 1; shift; shift >>= 1){
|
for(std::size_t shift = Bits >> 1; shift; shift >>= 1){
|
||||||
std::size_t tmp = n >> shift;
|
std::size_t tmp = n >> shift;
|
||||||
if (tmp)
|
if (tmp)
|
||||||
|
@@ -151,7 +151,7 @@ struct node_alloc_holder
|
|||||||
{ this->icont().swap(x.icont()); }
|
{ this->icont().swap(x.icont()); }
|
||||||
|
|
||||||
void copy_assign_alloc(const node_alloc_holder &x)
|
void copy_assign_alloc(const node_alloc_holder &x)
|
||||||
{
|
{
|
||||||
container_detail::bool_<allocator_traits_type::propagate_on_container_copy_assignment::value> flag;
|
container_detail::bool_<allocator_traits_type::propagate_on_container_copy_assignment::value> flag;
|
||||||
container_detail::assign_alloc( static_cast<NodeAlloc &>(this->members_)
|
container_detail::assign_alloc( static_cast<NodeAlloc &>(this->members_)
|
||||||
, static_cast<const NodeAlloc &>(x.members_), flag);
|
, static_cast<const NodeAlloc &>(x.members_), flag);
|
||||||
|
@@ -35,7 +35,7 @@ namespace container {
|
|||||||
namespace container_detail {
|
namespace container_detail {
|
||||||
|
|
||||||
//!Pooled memory allocator using single segregated storage. Includes
|
//!Pooled memory allocator using single segregated storage. Includes
|
||||||
//!a reference count but the class does not delete itself, this is
|
//!a reference count but the class does not delete itself, this is
|
||||||
//!responsibility of user classes. Node size (NodeSize) and the number of
|
//!responsibility of user classes. Node size (NodeSize) and the number of
|
||||||
//!nodes allocated per block (NodesPerBlock) are known at compile time
|
//!nodes allocated per block (NodesPerBlock) are known at compile time
|
||||||
template< std::size_t NodeSize, std::size_t NodesPerBlock >
|
template< std::size_t NodeSize, std::size_t NodesPerBlock >
|
||||||
@@ -64,8 +64,8 @@ class private_node_pool
|
|||||||
template< std::size_t NodeSize
|
template< std::size_t NodeSize
|
||||||
, std::size_t NodesPerBlock
|
, std::size_t NodesPerBlock
|
||||||
>
|
>
|
||||||
class shared_node_pool
|
class shared_node_pool
|
||||||
: public private_node_pool<NodeSize, NodesPerBlock>
|
: public private_node_pool<NodeSize, NodesPerBlock>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
typedef private_node_pool<NodeSize, NodesPerBlock> private_node_allocator_t;
|
typedef private_node_pool<NodeSize, NodesPerBlock> private_node_allocator_t;
|
||||||
@@ -90,7 +90,7 @@ class shared_node_pool
|
|||||||
//-----------------------
|
//-----------------------
|
||||||
return private_node_allocator_t::allocate_node();
|
return private_node_allocator_t::allocate_node();
|
||||||
}
|
}
|
||||||
|
|
||||||
//!Deallocates an array pointed by ptr. Never throws
|
//!Deallocates an array pointed by ptr. Never throws
|
||||||
void deallocate_node(void *ptr)
|
void deallocate_node(void *ptr)
|
||||||
{
|
{
|
||||||
|
@@ -87,7 +87,7 @@ class private_node_pool_impl
|
|||||||
|
|
||||||
void *allocate_node()
|
void *allocate_node()
|
||||||
{ return this->priv_alloc_node(); }
|
{ return this->priv_alloc_node(); }
|
||||||
|
|
||||||
//!Deallocates an array pointed by ptr. Never throws
|
//!Deallocates an array pointed by ptr. Never throws
|
||||||
void deallocate_node(void *ptr)
|
void deallocate_node(void *ptr)
|
||||||
{ this->priv_dealloc_node(ptr); }
|
{ this->priv_dealloc_node(ptr); }
|
||||||
@@ -235,7 +235,7 @@ class private_node_pool_impl
|
|||||||
push_in_list(free_nodes_t &l, typename free_nodes_t::iterator &it)
|
push_in_list(free_nodes_t &l, typename free_nodes_t::iterator &it)
|
||||||
: slist_(l), last_it_(it)
|
: slist_(l), last_it_(it)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void operator()(typename free_nodes_t::pointer p) const
|
void operator()(typename free_nodes_t::pointer p) const
|
||||||
{
|
{
|
||||||
slist_.push_front(*p);
|
slist_.push_front(*p);
|
||||||
@@ -257,7 +257,7 @@ class private_node_pool_impl
|
|||||||
is_between(const void *addr, std::size_t size)
|
is_between(const void *addr, std::size_t size)
|
||||||
: beg_(static_cast<const char *>(addr)), end_(beg_+size)
|
: beg_(static_cast<const char *>(addr)), end_(beg_+size)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
bool operator()(typename free_nodes_t::const_reference v) const
|
bool operator()(typename free_nodes_t::const_reference v) const
|
||||||
{
|
{
|
||||||
return (beg_ <= reinterpret_cast<const char *>(&v) &&
|
return (beg_ <= reinterpret_cast<const char *>(&v) &&
|
||||||
@@ -334,13 +334,13 @@ class private_node_pool_impl
|
|||||||
private:
|
private:
|
||||||
//!Returns a reference to the block hook placed in the end of the block
|
//!Returns a reference to the block hook placed in the end of the block
|
||||||
static node_t & get_block_hook (void *block, size_type blocksize)
|
static node_t & get_block_hook (void *block, size_type blocksize)
|
||||||
{
|
{
|
||||||
return *reinterpret_cast<node_t*>(reinterpret_cast<char*>(block) + blocksize);
|
return *reinterpret_cast<node_t*>(reinterpret_cast<char*>(block) + blocksize);
|
||||||
}
|
}
|
||||||
|
|
||||||
//!Returns the starting address of the block reference to the block hook placed in the end of the block
|
//!Returns the starting address of the block reference to the block hook placed in the end of the block
|
||||||
void *get_block_from_hook (node_t *hook, size_type blocksize)
|
void *get_block_from_hook (node_t *hook, size_type blocksize)
|
||||||
{
|
{
|
||||||
return (reinterpret_cast<char*>(hook) - blocksize);
|
return (reinterpret_cast<char*>(hook) - blocksize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -385,7 +385,7 @@ class RecyclingCloner
|
|||||||
{ p->do_assign(other.m_data); }
|
{ p->do_assign(other.m_data); }
|
||||||
|
|
||||||
static void do_assign(node_ptr_type &p, const node_type &other, bool_<false>)
|
static void do_assign(node_ptr_type &p, const node_type &other, bool_<false>)
|
||||||
{ p->do_move_assign(const_cast<node_type &>(other).m_data); }
|
{ p->do_move_assign(const_cast<node_type &>(other).m_data); }
|
||||||
|
|
||||||
node_ptr_type operator()(const node_type &other) const
|
node_ptr_type operator()(const node_type &other) const
|
||||||
{
|
{
|
||||||
@@ -461,7 +461,7 @@ class tree
|
|||||||
typedef typename container_detail::intrusive_tree_type
|
typedef typename container_detail::intrusive_tree_type
|
||||||
< A, ValComp, Options::tree_type
|
< A, ValComp, Options::tree_type
|
||||||
, Options::optimize_size>::type Icont;
|
, Options::optimize_size>::type Icont;
|
||||||
typedef container_detail::node_alloc_holder
|
typedef container_detail::node_alloc_holder
|
||||||
<A, Icont> AllocHolder;
|
<A, Icont> AllocHolder;
|
||||||
typedef typename AllocHolder::NodePtr NodePtr;
|
typedef typename AllocHolder::NodePtr NodePtr;
|
||||||
typedef tree < Key, Value, KeyOfValue
|
typedef tree < Key, Value, KeyOfValue
|
||||||
@@ -723,7 +723,7 @@ class tree
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// accessors:
|
// accessors:
|
||||||
value_compare value_comp() const
|
value_compare value_comp() const
|
||||||
{ return this->icont().value_comp().value_comp(); }
|
{ return this->icont().value_comp().value_comp(); }
|
||||||
|
@@ -1159,7 +1159,7 @@ template
|
|||||||
<typename A
|
<typename A
|
||||||
,typename I // F models InputIterator
|
,typename I // F models InputIterator
|
||||||
,typename O // G models OutputIterator
|
,typename O // G models OutputIterator
|
||||||
>
|
>
|
||||||
void copy_assign_range_alloc_n( A &a, I inp_start, typename allocator_traits<A>::size_type n_i
|
void copy_assign_range_alloc_n( A &a, I inp_start, typename allocator_traits<A>::size_type n_i
|
||||||
, O out_start, typename allocator_traits<A>::size_type n_o )
|
, O out_start, typename allocator_traits<A>::size_type n_o )
|
||||||
{
|
{
|
||||||
@@ -1183,7 +1183,7 @@ template
|
|||||||
<typename A
|
<typename A
|
||||||
,typename I // F models InputIterator
|
,typename I // F models InputIterator
|
||||||
,typename O // G models OutputIterator
|
,typename O // G models OutputIterator
|
||||||
>
|
>
|
||||||
void move_assign_range_alloc_n( A &a, I inp_start, typename allocator_traits<A>::size_type n_i
|
void move_assign_range_alloc_n( A &a, I inp_start, typename allocator_traits<A>::size_type n_i
|
||||||
, O out_start, typename allocator_traits<A>::size_type n_o )
|
, O out_start, typename allocator_traits<A>::size_type n_o )
|
||||||
{
|
{
|
||||||
|
@@ -457,7 +457,7 @@ class flat_map
|
|||||||
//! <b>Throws</b>: Nothing.
|
//! <b>Throws</b>: Nothing.
|
||||||
//!
|
//!
|
||||||
//! <b>Complexity</b>: Constant.
|
//! <b>Complexity</b>: Constant.
|
||||||
size_type capacity() const BOOST_CONTAINER_NOEXCEPT
|
size_type capacity() const BOOST_CONTAINER_NOEXCEPT
|
||||||
{ return m_flat_tree.capacity(); }
|
{ return m_flat_tree.capacity(); }
|
||||||
|
|
||||||
//! <b>Effects</b>: If n is less than or equal to capacity(), this call has no
|
//! <b>Effects</b>: If n is less than or equal to capacity(), this call has no
|
||||||
@@ -469,7 +469,7 @@ class flat_map
|
|||||||
//!
|
//!
|
||||||
//! <b>Note</b>: If capacity() is less than "cnt", iterators and references to
|
//! <b>Note</b>: If capacity() is less than "cnt", iterators and references to
|
||||||
//! to values might be invalidated.
|
//! to values might be invalidated.
|
||||||
void reserve(size_type cnt)
|
void reserve(size_type cnt)
|
||||||
{ m_flat_tree.reserve(cnt); }
|
{ m_flat_tree.reserve(cnt); }
|
||||||
|
|
||||||
//! <b>Effects</b>: Tries to deallocate the excess of memory created
|
//! <b>Effects</b>: Tries to deallocate the excess of memory created
|
||||||
@@ -1362,7 +1362,7 @@ class flat_multimap
|
|||||||
//!
|
//!
|
||||||
//! <b>Note</b>: If capacity() is less than "cnt", iterators and references to
|
//! <b>Note</b>: If capacity() is less than "cnt", iterators and references to
|
||||||
//! to values might be invalidated.
|
//! to values might be invalidated.
|
||||||
void reserve(size_type cnt)
|
void reserve(size_type cnt)
|
||||||
{ m_flat_tree.reserve(cnt); }
|
{ m_flat_tree.reserve(cnt); }
|
||||||
|
|
||||||
//! <b>Effects</b>: Tries to deallocate the excess of memory created
|
//! <b>Effects</b>: Tries to deallocate the excess of memory created
|
||||||
|
@@ -1193,7 +1193,7 @@ class list
|
|||||||
//! <b>Throws</b>: If comparison throws.
|
//! <b>Throws</b>: If comparison throws.
|
||||||
//!
|
//!
|
||||||
//! <b>Notes</b>: Iterators and references are not invalidated.
|
//! <b>Notes</b>: Iterators and references are not invalidated.
|
||||||
//!
|
//!
|
||||||
//! <b>Complexity</b>: The number of comparisons is approximately N log N, where N
|
//! <b>Complexity</b>: The number of comparisons is approximately N log N, where N
|
||||||
//! is the list's size.
|
//! is the list's size.
|
||||||
void sort()
|
void sort()
|
||||||
@@ -1326,13 +1326,13 @@ class list
|
|||||||
return iterator(this->icont().insert(p.get(), *tmp));
|
return iterator(this->icont().insert(p.get(), *tmp));
|
||||||
}
|
}
|
||||||
|
|
||||||
void priv_push_back (const T &x)
|
void priv_push_back (const T &x)
|
||||||
{ this->insert(this->cend(), x); }
|
{ this->insert(this->cend(), x); }
|
||||||
|
|
||||||
void priv_push_back (BOOST_RV_REF(T) x)
|
void priv_push_back (BOOST_RV_REF(T) x)
|
||||||
{ this->insert(this->cend(), boost::move(x)); }
|
{ this->insert(this->cend(), boost::move(x)); }
|
||||||
|
|
||||||
void priv_push_front (const T &x)
|
void priv_push_front (const T &x)
|
||||||
{ this->insert(this->cbegin(), x); }
|
{ this->insert(this->cbegin(), x); }
|
||||||
|
|
||||||
void priv_push_front (BOOST_RV_REF(T) x)
|
void priv_push_front (BOOST_RV_REF(T) x)
|
||||||
|
@@ -91,12 +91,12 @@ class node_allocator
|
|||||||
transform_multiallocation_chain
|
transform_multiallocation_chain
|
||||||
<multiallocation_chain_void, T> multiallocation_chain;
|
<multiallocation_chain_void, T> multiallocation_chain;
|
||||||
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
#endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
||||||
|
|
||||||
//!Obtains node_allocator from
|
//!Obtains node_allocator from
|
||||||
//!node_allocator
|
//!node_allocator
|
||||||
template<class T2>
|
template<class T2>
|
||||||
struct rebind
|
struct rebind
|
||||||
{
|
{
|
||||||
typedef node_allocator< T2, NodesPerBlock
|
typedef node_allocator< T2, NodesPerBlock
|
||||||
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
||||||
, Version
|
, Version
|
||||||
@@ -144,7 +144,7 @@ class node_allocator
|
|||||||
size_type max_size() const
|
size_type max_size() const
|
||||||
{ return size_type(-1)/sizeof(T); }
|
{ return size_type(-1)/sizeof(T); }
|
||||||
|
|
||||||
//!Allocate memory for an array of count elements.
|
//!Allocate memory for an array of count elements.
|
||||||
//!Throws std::bad_alloc if there is no enough memory
|
//!Throws std::bad_alloc if there is no enough memory
|
||||||
pointer allocate(size_type count, const void * = 0)
|
pointer allocate(size_type count, const void * = 0)
|
||||||
{
|
{
|
||||||
@@ -192,7 +192,7 @@ class node_allocator
|
|||||||
|
|
||||||
std::pair<pointer, bool>
|
std::pair<pointer, bool>
|
||||||
allocation_command(allocation_type command,
|
allocation_command(allocation_type command,
|
||||||
size_type limit_size,
|
size_type limit_size,
|
||||||
size_type preferred_size,
|
size_type preferred_size,
|
||||||
size_type &received_size, pointer reuse = pointer())
|
size_type &received_size, pointer reuse = pointer())
|
||||||
{
|
{
|
||||||
@@ -259,7 +259,7 @@ class node_allocator
|
|||||||
singleton_t::instance().deallocate_nodes(ch);
|
singleton_t::instance().deallocate_nodes(ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
//!Allocates many elements of size elem_size.
|
//!Allocates many elements of size elem_size.
|
||||||
//!Elements must be individually deallocated with deallocate()
|
//!Elements must be individually deallocated with deallocate()
|
||||||
void allocate_many(size_type elem_size, std::size_t n_elements, multiallocation_chain &chain)
|
void allocate_many(size_type elem_size, std::size_t n_elements, multiallocation_chain &chain)
|
||||||
{
|
{
|
||||||
@@ -275,7 +275,7 @@ class node_allocator
|
|||||||
, BOOST_CONTAINER_MEMCHAIN_SIZE(&ch));
|
, BOOST_CONTAINER_MEMCHAIN_SIZE(&ch));
|
||||||
}
|
}
|
||||||
|
|
||||||
//!Allocates n_elements elements, each one of size elem_sizes[i]
|
//!Allocates n_elements elements, each one of size elem_sizes[i]
|
||||||
//!Elements must be individually deallocated with deallocate()
|
//!Elements must be individually deallocated with deallocate()
|
||||||
void allocate_many(const size_type *elem_sizes, size_type n_elements, multiallocation_chain &chain)
|
void allocate_many(const size_type *elem_sizes, size_type n_elements, multiallocation_chain &chain)
|
||||||
{
|
{
|
||||||
@@ -318,7 +318,7 @@ class node_allocator
|
|||||||
{ return false; }
|
{ return false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::pair<pointer, bool> priv_allocation_command
|
std::pair<pointer, bool> priv_allocation_command
|
||||||
(allocation_type command, std::size_t limit_size
|
(allocation_type command, std::size_t limit_size
|
||||||
,std::size_t preferred_size,std::size_t &received_size, void *reuse_ptr)
|
,std::size_t preferred_size,std::size_t &received_size, void *reuse_ptr)
|
||||||
{
|
{
|
||||||
|
@@ -47,7 +47,7 @@ namespace boost { namespace container {
|
|||||||
//! ill-formed.
|
//! ill-formed.
|
||||||
//!
|
//!
|
||||||
//! <code>
|
//! <code>
|
||||||
//! template <class T, class Allocator = allocator<T> >
|
//! template <class T, class Allocator = allocator<T> >
|
||||||
//! class Z {
|
//! class Z {
|
||||||
//! public:
|
//! public:
|
||||||
//! typedef Allocator allocator_type;
|
//! typedef Allocator allocator_type;
|
||||||
@@ -62,7 +62,7 @@ namespace boost { namespace container {
|
|||||||
//!
|
//!
|
||||||
//! // Specialize trait for class template Z
|
//! // Specialize trait for class template Z
|
||||||
//! template <class T, class Allocator = allocator<T> >
|
//! template <class T, class Allocator = allocator<T> >
|
||||||
//! struct constructible_with_allocator_suffix<Z<T,Allocator> >
|
//! struct constructible_with_allocator_suffix<Z<T,Allocator> >
|
||||||
//! : ::boost::true_type { };
|
//! : ::boost::true_type { };
|
||||||
//! </code>
|
//! </code>
|
||||||
//!
|
//!
|
||||||
@@ -80,7 +80,7 @@ struct constructible_with_allocator_suffix
|
|||||||
{};
|
{};
|
||||||
|
|
||||||
//! <b>Remark</b>: if a specialization is derived from true_type, indicates that T may be constructed
|
//! <b>Remark</b>: if a specialization is derived from true_type, indicates that T may be constructed
|
||||||
//! with allocator_arg and T::allocator_type as its first two constructor arguments.
|
//! with allocator_arg and T::allocator_type as its first two constructor arguments.
|
||||||
//! Ideally, all constructors of T (including the copy and move constructors) should have a variant
|
//! Ideally, all constructors of T (including the copy and move constructors) should have a variant
|
||||||
//! that accepts these two initial arguments.
|
//! that accepts these two initial arguments.
|
||||||
//!
|
//!
|
||||||
@@ -95,26 +95,26 @@ struct constructible_with_allocator_suffix
|
|||||||
//! class Y {
|
//! class Y {
|
||||||
//! public:
|
//! public:
|
||||||
//! typedef Allocator allocator_type;
|
//! typedef Allocator allocator_type;
|
||||||
//!
|
//!
|
||||||
//! // Default constructor with and allocator-extended default constructor
|
//! // Default constructor with and allocator-extended default constructor
|
||||||
//! Y();
|
//! Y();
|
||||||
//! Y(allocator_arg_t, const allocator_type& a);
|
//! Y(allocator_arg_t, const allocator_type& a);
|
||||||
//!
|
//!
|
||||||
//! // Copy constructor and allocator-extended copy constructor
|
//! // Copy constructor and allocator-extended copy constructor
|
||||||
//! Y(const Y& yy);
|
//! Y(const Y& yy);
|
||||||
//! Y(allocator_arg_t, const allocator_type& a, const Y& yy);
|
//! Y(allocator_arg_t, const allocator_type& a, const Y& yy);
|
||||||
//!
|
//!
|
||||||
//! // Variadic constructor and allocator-extended variadic constructor
|
//! // Variadic constructor and allocator-extended variadic constructor
|
||||||
//! template<class ...Args> Y(Args&& args...);
|
//! template<class ...Args> Y(Args&& args...);
|
||||||
//! template<class ...Args>
|
//! template<class ...Args>
|
||||||
//! Y(allocator_arg_t, const allocator_type& a, Args&&... args);
|
//! Y(allocator_arg_t, const allocator_type& a, Args&&... args);
|
||||||
//! };
|
//! };
|
||||||
//!
|
//!
|
||||||
//! // Specialize trait for class template Y
|
//! // Specialize trait for class template Y
|
||||||
//! template <class T, class Allocator = allocator<T> >
|
//! template <class T, class Allocator = allocator<T> >
|
||||||
//! struct constructible_with_allocator_prefix<Y<T,Allocator> >
|
//! struct constructible_with_allocator_prefix<Y<T,Allocator> >
|
||||||
//! : ::boost::true_type { };
|
//! : ::boost::true_type { };
|
||||||
//!
|
//!
|
||||||
//! </code>
|
//! </code>
|
||||||
//!
|
//!
|
||||||
//! <b>Note</b>: This trait is a workaround inspired by "N2554: The Scoped Allocator Model (Rev 2)"
|
//! <b>Note</b>: This trait is a workaround inspired by "N2554: The Scoped Allocator Model (Rev 2)"
|
||||||
@@ -960,7 +960,7 @@ class scoped_allocator_adaptor_base
|
|||||||
scoped_allocator_adaptor_base(internal_type_t, BOOST_FWD_REF(OuterA2) outerAlloc, const inner_allocator_type &)
|
scoped_allocator_adaptor_base(internal_type_t, BOOST_FWD_REF(OuterA2) outerAlloc, const inner_allocator_type &)
|
||||||
: outer_allocator_type(::boost::forward<OuterA2>(outerAlloc))
|
: outer_allocator_type(::boost::forward<OuterA2>(outerAlloc))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
scoped_allocator_adaptor_base &operator=(BOOST_COPY_ASSIGN_REF(scoped_allocator_adaptor_base) other)
|
scoped_allocator_adaptor_base &operator=(BOOST_COPY_ASSIGN_REF(scoped_allocator_adaptor_base) other)
|
||||||
{
|
{
|
||||||
@@ -1375,7 +1375,7 @@ class scoped_allocator_adaptor
|
|||||||
template <class T1, class T2, class U, class V>
|
template <class T1, class T2, class U, class V>
|
||||||
void construct(container_detail::pair<T1, T2>* p, BOOST_FWD_REF(U) x, BOOST_FWD_REF(V) y)
|
void construct(container_detail::pair<T1, T2>* p, BOOST_FWD_REF(U) x, BOOST_FWD_REF(V) y)
|
||||||
{ this->construct_pair(p, ::boost::forward<U>(x), ::boost::forward<V>(y)); }
|
{ this->construct_pair(p, ::boost::forward<U>(x), ::boost::forward<V>(y)); }
|
||||||
|
|
||||||
template <class T1, class T2, class U, class V>
|
template <class T1, class T2, class U, class V>
|
||||||
void construct(std::pair<T1, T2>* p, const std::pair<U, V>& x)
|
void construct(std::pair<T1, T2>* p, const std::pair<U, V>& x)
|
||||||
{ this->construct_pair(p, x); }
|
{ this->construct_pair(p, x); }
|
||||||
@@ -1384,7 +1384,7 @@ class scoped_allocator_adaptor
|
|||||||
void construct( container_detail::pair<T1, T2>* p
|
void construct( container_detail::pair<T1, T2>* p
|
||||||
, const container_detail::pair<U, V>& x)
|
, const container_detail::pair<U, V>& x)
|
||||||
{ this->construct_pair(p, x); }
|
{ this->construct_pair(p, x); }
|
||||||
|
|
||||||
template <class T1, class T2, class U, class V>
|
template <class T1, class T2, class U, class V>
|
||||||
void construct( std::pair<T1, T2>* p
|
void construct( std::pair<T1, T2>* p
|
||||||
, BOOST_RV_REF_BEG std::pair<U, V> BOOST_RV_REF_END x)
|
, BOOST_RV_REF_BEG std::pair<U, V> BOOST_RV_REF_END x)
|
||||||
@@ -1489,7 +1489,7 @@ inline bool operator==(
|
|||||||
#endif
|
#endif
|
||||||
>& b)
|
>& b)
|
||||||
{
|
{
|
||||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
|
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
|
||||||
const bool has_zero_inner = sizeof...(InnerAllocs) == 0u;
|
const bool has_zero_inner = sizeof...(InnerAllocs) == 0u;
|
||||||
#else
|
#else
|
||||||
const bool has_zero_inner =
|
const bool has_zero_inner =
|
||||||
|
@@ -1295,7 +1295,7 @@ class slist
|
|||||||
this->insert_after(prev, n, x);
|
this->insert_after(prev, n, x);
|
||||||
return ++iterator(prev.get());
|
return ++iterator(prev.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
//! <b>Requires</b>: p must be a valid iterator of *this.
|
//! <b>Requires</b>: p must be a valid iterator of *this.
|
||||||
//!
|
//!
|
||||||
//! <b>Effects</b>: Insert a copy of the [first, last) range before p.
|
//! <b>Effects</b>: Insert a copy of the [first, last) range before p.
|
||||||
@@ -1493,7 +1493,7 @@ class slist
|
|||||||
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void priv_push_front (const T &x)
|
void priv_push_front (const T &x)
|
||||||
{ this->insert_after(this->cbefore_begin(), x); }
|
{ this->insert_after(this->cbefore_begin(), x); }
|
||||||
|
|
||||||
void priv_push_front (BOOST_RV_REF(T) x)
|
void priv_push_front (BOOST_RV_REF(T) x)
|
||||||
|
@@ -77,7 +77,7 @@ class clear_on_destroy
|
|||||||
{
|
{
|
||||||
if(do_clear_){
|
if(do_clear_){
|
||||||
c_.clear();
|
c_.clear();
|
||||||
c_.priv_clear_pool();
|
c_.priv_clear_pool();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -708,7 +708,7 @@ class stable_vector
|
|||||||
~stable_vector()
|
~stable_vector()
|
||||||
{
|
{
|
||||||
this->clear();
|
this->clear();
|
||||||
this->priv_clear_pool();
|
this->priv_clear_pool();
|
||||||
}
|
}
|
||||||
|
|
||||||
//! <b>Effects</b>: Makes *this contain the same elements as x.
|
//! <b>Effects</b>: Makes *this contain the same elements as x.
|
||||||
@@ -1068,7 +1068,7 @@ class stable_vector
|
|||||||
throw_length_error("stable_vector::reserve max_size() exceeded");
|
throw_length_error("stable_vector::reserve max_size() exceeded");
|
||||||
}
|
}
|
||||||
|
|
||||||
size_type sz = this->size();
|
size_type sz = this->size();
|
||||||
size_type old_capacity = this->capacity();
|
size_type old_capacity = this->capacity();
|
||||||
if(n > old_capacity){
|
if(n > old_capacity){
|
||||||
index_traits_type::initialize_end_node(this->index, this->internal_data.end_node, n);
|
index_traits_type::initialize_end_node(this->index, this->internal_data.end_node, n);
|
||||||
|
@@ -73,12 +73,12 @@ class static_storage_allocator
|
|||||||
//!change in size, along with the static allocation, low overhead, and fixed capacity of boost::array.
|
//!change in size, along with the static allocation, low overhead, and fixed capacity of boost::array.
|
||||||
//!
|
//!
|
||||||
//!A static_vector is a sequence that supports random access to elements, constant time insertion and
|
//!A static_vector is a sequence that supports random access to elements, constant time insertion and
|
||||||
//!removal of elements at the end, and linear time insertion and removal of elements at the beginning or
|
//!removal of elements at the end, and linear time insertion and removal of elements at the beginning or
|
||||||
//!in the middle. The number of elements in a static_vector may vary dynamically up to a fixed capacity
|
//!in the middle. The number of elements in a static_vector may vary dynamically up to a fixed capacity
|
||||||
//!because elements are stored within the object itself similarly to an array. However, objects are
|
//!because elements are stored within the object itself similarly to an array. However, objects are
|
||||||
//!initialized as they are inserted into static_vector unlike C arrays or std::array which must construct
|
//!initialized as they are inserted into static_vector unlike C arrays or std::array which must construct
|
||||||
//!all elements on instantiation. The behavior of static_vector enables the use of statically allocated
|
//!all elements on instantiation. The behavior of static_vector enables the use of statically allocated
|
||||||
//!elements in cases with complex object lifetime requirements that would otherwise not be trivially
|
//!elements in cases with complex object lifetime requirements that would otherwise not be trivially
|
||||||
//!possible.
|
//!possible.
|
||||||
//!
|
//!
|
||||||
//!@par Error Handling
|
//!@par Error Handling
|
||||||
|
@@ -55,7 +55,7 @@ namespace container {
|
|||||||
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
||||||
namespace container_detail {
|
namespace container_detail {
|
||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
// Class basic_string_base.
|
// Class basic_string_base.
|
||||||
|
|
||||||
// basic_string_base is a helper class that makes it it easier to write
|
// basic_string_base is a helper class that makes it it easier to write
|
||||||
// an exception-safe version of basic_string. The constructor allocates,
|
// an exception-safe version of basic_string. The constructor allocates,
|
||||||
@@ -88,20 +88,20 @@ class basic_string_base
|
|||||||
|
|
||||||
basic_string_base(const allocator_type& a, size_type n)
|
basic_string_base(const allocator_type& a, size_type n)
|
||||||
: members_(a)
|
: members_(a)
|
||||||
{
|
{
|
||||||
this->init();
|
this->init();
|
||||||
this->allocate_initial_block(n);
|
this->allocate_initial_block(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
basic_string_base(BOOST_RV_REF(basic_string_base) b)
|
basic_string_base(BOOST_RV_REF(basic_string_base) b)
|
||||||
: members_(boost::move(b.alloc()))
|
: members_(boost::move(b.alloc()))
|
||||||
{
|
{
|
||||||
this->init();
|
this->init();
|
||||||
this->swap_data(b);
|
this->swap_data(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
~basic_string_base()
|
~basic_string_base()
|
||||||
{
|
{
|
||||||
if(!this->is_short()){
|
if(!this->is_short()){
|
||||||
this->deallocate_block();
|
this->deallocate_block();
|
||||||
this->is_short(true);
|
this->is_short(true);
|
||||||
@@ -149,7 +149,7 @@ class basic_string_base
|
|||||||
|
|
||||||
//This type has the same alignment and size as long_t but it's POD
|
//This type has the same alignment and size as long_t but it's POD
|
||||||
//so, unlike long_t, it can be placed in a union
|
//so, unlike long_t, it can be placed in a union
|
||||||
|
|
||||||
typedef typename boost::aligned_storage< sizeof(long_t),
|
typedef typename boost::aligned_storage< sizeof(long_t),
|
||||||
container_detail::alignment_of<long_t>::value>::type long_raw_t;
|
container_detail::alignment_of<long_t>::value>::type long_raw_t;
|
||||||
|
|
||||||
@@ -276,7 +276,7 @@ class basic_string_base
|
|||||||
}
|
}
|
||||||
|
|
||||||
void deallocate(pointer p, size_type n)
|
void deallocate(pointer p, size_type n)
|
||||||
{
|
{
|
||||||
if (p && (n > InternalBufferChars))
|
if (p && (n > InternalBufferChars))
|
||||||
this->alloc().deallocate(p, n);
|
this->alloc().deallocate(p, n);
|
||||||
}
|
}
|
||||||
@@ -325,7 +325,7 @@ class basic_string_base
|
|||||||
|
|
||||||
void deallocate_block()
|
void deallocate_block()
|
||||||
{ this->deallocate(this->priv_addr(), this->priv_storage()); }
|
{ this->deallocate(this->priv_addr(), this->priv_storage()); }
|
||||||
|
|
||||||
size_type max_size() const
|
size_type max_size() const
|
||||||
{ return allocator_traits_type::max_size(this->alloc()) - 1; }
|
{ return allocator_traits_type::max_size(this->alloc()) - 1; }
|
||||||
|
|
||||||
@@ -368,13 +368,13 @@ class basic_string_base
|
|||||||
{ return this->members_.m_repr.long_repr().storage; }
|
{ return this->members_.m_repr.long_repr().storage; }
|
||||||
|
|
||||||
void priv_storage(size_type storage)
|
void priv_storage(size_type storage)
|
||||||
{
|
{
|
||||||
if(!this->is_short())
|
if(!this->is_short())
|
||||||
this->priv_long_storage(storage);
|
this->priv_long_storage(storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void priv_long_storage(size_type storage)
|
void priv_long_storage(size_type storage)
|
||||||
{
|
{
|
||||||
this->members_.m_repr.long_repr().storage = storage;
|
this->members_.m_repr.long_repr().storage = storage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -388,7 +388,7 @@ class basic_string_base
|
|||||||
{ return this->members_.m_repr.long_repr().length; }
|
{ return this->members_.m_repr.long_repr().length; }
|
||||||
|
|
||||||
void priv_size(size_type sz)
|
void priv_size(size_type sz)
|
||||||
{
|
{
|
||||||
if(this->is_short())
|
if(this->is_short())
|
||||||
this->priv_short_size(sz);
|
this->priv_short_size(sz);
|
||||||
else
|
else
|
||||||
@@ -396,12 +396,12 @@ class basic_string_base
|
|||||||
}
|
}
|
||||||
|
|
||||||
void priv_short_size(size_type sz)
|
void priv_short_size(size_type sz)
|
||||||
{
|
{
|
||||||
this->members_.m_repr.s.h.length = (unsigned char)sz;
|
this->members_.m_repr.s.h.length = (unsigned char)sz;
|
||||||
}
|
}
|
||||||
|
|
||||||
void priv_long_size(size_type sz)
|
void priv_long_size(size_type sz)
|
||||||
{
|
{
|
||||||
this->members_.m_repr.long_repr().length = sz;
|
this->members_.m_repr.long_repr().length = sz;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -706,7 +706,7 @@ class basic_string
|
|||||||
//! <b>Complexity</b>: Constant.
|
//! <b>Complexity</b>: Constant.
|
||||||
~basic_string() BOOST_CONTAINER_NOEXCEPT
|
~basic_string() BOOST_CONTAINER_NOEXCEPT
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//! <b>Effects</b>: Copy constructs a string.
|
//! <b>Effects</b>: Copy constructs a string.
|
||||||
//!
|
//!
|
||||||
//! <b>Postcondition</b>: x == *this.
|
//! <b>Postcondition</b>: x == *this.
|
||||||
@@ -1236,7 +1236,7 @@ class basic_string
|
|||||||
//! length n whose elements are a copy of those pointed to by s.
|
//! length n whose elements are a copy of those pointed to by s.
|
||||||
//!
|
//!
|
||||||
//! <b>Throws</b>: If memory allocation throws or length_error if n > max_size().
|
//! <b>Throws</b>: If memory allocation throws or length_error if n > max_size().
|
||||||
//!
|
//!
|
||||||
//! <b>Returns</b>: *this
|
//! <b>Returns</b>: *this
|
||||||
basic_string& assign(const CharT* s, size_type n)
|
basic_string& assign(const CharT* s, size_type n)
|
||||||
{ return this->assign(s, s + n); }
|
{ return this->assign(s, s + n); }
|
||||||
@@ -1258,16 +1258,16 @@ class basic_string
|
|||||||
//! <b>Effects</b>: Equivalent to assign(basic_string(first, last)).
|
//! <b>Effects</b>: Equivalent to assign(basic_string(first, last)).
|
||||||
//!
|
//!
|
||||||
//! <b>Returns</b>: *this
|
//! <b>Returns</b>: *this
|
||||||
basic_string& assign(const CharT* first, const CharT* last)
|
basic_string& assign(const CharT* first, const CharT* last)
|
||||||
{
|
{
|
||||||
size_type n = static_cast<size_type>(last - first);
|
size_type n = static_cast<size_type>(last - first);
|
||||||
this->reserve(n);
|
this->reserve(n);
|
||||||
CharT* ptr = container_detail::to_raw_pointer(this->priv_addr());
|
CharT* ptr = container_detail::to_raw_pointer(this->priv_addr());
|
||||||
Traits::copy(ptr, first, n);
|
Traits::copy(ptr, first, n);
|
||||||
this->priv_construct_null(ptr + n);
|
this->priv_construct_null(ptr + n);
|
||||||
this->priv_size(n);
|
this->priv_size(n);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! <b>Effects</b>: Equivalent to assign(basic_string(first, last)).
|
//! <b>Effects</b>: Equivalent to assign(basic_string(first, last)).
|
||||||
//!
|
//!
|
||||||
@@ -1435,7 +1435,7 @@ class basic_string
|
|||||||
for ( ; first != last; ++first, ++p) {
|
for ( ; first != last; ++first, ++p) {
|
||||||
p = this->insert(p, *first);
|
p = this->insert(p, *first);
|
||||||
}
|
}
|
||||||
return this->begin() + n_pos;
|
return this->begin() + n_pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
|
#if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
|
||||||
@@ -1459,7 +1459,7 @@ class basic_string
|
|||||||
|
|
||||||
//Check if we have enough capacity
|
//Check if we have enough capacity
|
||||||
if (remaining >= n){
|
if (remaining >= n){
|
||||||
enough_capacity = true;
|
enough_capacity = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//Otherwise expand current buffer or allocate new storage
|
//Otherwise expand current buffer or allocate new storage
|
||||||
@@ -1568,7 +1568,7 @@ class basic_string
|
|||||||
const pointer addr = this->priv_addr();
|
const pointer addr = this->priv_addr();
|
||||||
erase(addr + pos, addr + pos + container_detail::min_value(n, this->size() - pos));
|
erase(addr + pos, addr + pos + container_detail::min_value(n, this->size() - pos));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! <b>Effects</b>: Removes the character referred to by p.
|
//! <b>Effects</b>: Removes the character referred to by p.
|
||||||
//!
|
//!
|
||||||
@@ -2527,7 +2527,7 @@ wstring;
|
|||||||
|
|
||||||
// Operator+
|
// Operator+
|
||||||
|
|
||||||
template <class CharT, class Traits, class Allocator> inline
|
template <class CharT, class Traits, class Allocator> inline
|
||||||
basic_string<CharT,Traits,Allocator>
|
basic_string<CharT,Traits,Allocator>
|
||||||
operator+(const basic_string<CharT,Traits,Allocator>& x
|
operator+(const basic_string<CharT,Traits,Allocator>& x
|
||||||
,const basic_string<CharT,Traits,Allocator>& y)
|
,const basic_string<CharT,Traits,Allocator>& y)
|
||||||
@@ -2576,7 +2576,7 @@ template <class CharT, class Traits, class Allocator> inline
|
|||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits, class Allocator> inline
|
template <class CharT, class Traits, class Allocator> inline
|
||||||
basic_string<CharT,Traits,Allocator> operator+
|
basic_string<CharT,Traits,Allocator> operator+
|
||||||
(basic_string<CharT,Traits,Allocator> x, const CharT* s)
|
(basic_string<CharT,Traits,Allocator> x, const CharT* s)
|
||||||
{
|
{
|
||||||
@@ -2592,7 +2592,7 @@ template <class CharT, class Traits, class Allocator> inline
|
|||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits, class Allocator> inline
|
template <class CharT, class Traits, class Allocator> inline
|
||||||
basic_string<CharT,Traits,Allocator> operator+
|
basic_string<CharT,Traits,Allocator> operator+
|
||||||
(basic_string<CharT,Traits,Allocator> x, const CharT c)
|
(basic_string<CharT,Traits,Allocator> x, const CharT c)
|
||||||
{
|
{
|
||||||
@@ -2736,7 +2736,7 @@ inline void swap(basic_string<CharT,Traits,Allocator>& x, basic_string<CharT,Tra
|
|||||||
{ x.swap(y); }
|
{ x.swap(y); }
|
||||||
|
|
||||||
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
|
||||||
// I/O.
|
// I/O.
|
||||||
namespace container_detail {
|
namespace container_detail {
|
||||||
|
|
||||||
template <class CharT, class Traits>
|
template <class CharT, class Traits>
|
||||||
@@ -2774,9 +2774,9 @@ operator<<(std::basic_ostream<CharT, Traits>& os, const basic_string<CharT,Trait
|
|||||||
|
|
||||||
if (w != 0 && n < w)
|
if (w != 0 && n < w)
|
||||||
pad_len = w - n;
|
pad_len = w - n;
|
||||||
|
|
||||||
if (!left)
|
if (!left)
|
||||||
ok = container_detail::string_fill(os, buf, pad_len);
|
ok = container_detail::string_fill(os, buf, pad_len);
|
||||||
|
|
||||||
ok = ok &&
|
ok = ok &&
|
||||||
buf->sputn(s.data(), std::streamsize(n)) == std::streamsize(n);
|
buf->sputn(s.data(), std::streamsize(n)) == std::streamsize(n);
|
||||||
@@ -2828,7 +2828,7 @@ operator>>(std::basic_istream<CharT, Traits>& is, basic_string<CharT,Traits,Allo
|
|||||||
s.push_back(c);
|
s.push_back(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we have read no characters, then set failbit.
|
// If we have read no characters, then set failbit.
|
||||||
if (s.size() == 0)
|
if (s.size() == 0)
|
||||||
is.setstate(std::ios_base::failbit);
|
is.setstate(std::ios_base::failbit);
|
||||||
@@ -2839,7 +2839,7 @@ operator>>(std::basic_istream<CharT, Traits>& is, basic_string<CharT,Traits,Allo
|
|||||||
return is;
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits, class Allocator>
|
template <class CharT, class Traits, class Allocator>
|
||||||
std::basic_istream<CharT, Traits>&
|
std::basic_istream<CharT, Traits>&
|
||||||
getline(std::istream& is, basic_string<CharT,Traits,Allocator>& s,CharT delim)
|
getline(std::istream& is, basic_string<CharT,Traits,Allocator>& s,CharT delim)
|
||||||
{
|
{
|
||||||
@@ -2871,7 +2871,7 @@ getline(std::istream& is, basic_string<CharT,Traits,Allocator>& s,CharT delim)
|
|||||||
return is;
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class CharT, class Traits, class Allocator>
|
template <class CharT, class Traits, class Allocator>
|
||||||
inline std::basic_istream<CharT, Traits>&
|
inline std::basic_istream<CharT, Traits>&
|
||||||
getline(std::basic_istream<CharT, Traits>& is, basic_string<CharT,Traits,Allocator>& s)
|
getline(std::basic_istream<CharT, Traits>& is, basic_string<CharT,Traits,Allocator>& s)
|
||||||
{
|
{
|
||||||
|
@@ -103,7 +103,7 @@ class vec_iterator
|
|||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
: m_ptr()
|
: m_ptr()
|
||||||
#else
|
#else
|
||||||
// No value initialization of m_ptr() to speed up things a bit:
|
// No value initialization of m_ptr() to speed up things a bit:
|
||||||
#endif
|
#endif
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@@ -790,7 +790,7 @@ class vector
|
|||||||
boost::container::destroy_alloc_n
|
boost::container::destroy_alloc_n
|
||||||
(this->get_stored_allocator(), container_detail::to_raw_pointer(this->m_holder.start()), this->m_holder.m_size);
|
(this->get_stored_allocator(), container_detail::to_raw_pointer(this->m_holder.start()), this->m_holder.m_size);
|
||||||
//vector_alloc_holder deallocates the data
|
//vector_alloc_holder deallocates the data
|
||||||
}
|
}
|
||||||
|
|
||||||
//! <b>Effects</b>: Makes *this contain the same elements as x.
|
//! <b>Effects</b>: Makes *this contain the same elements as x.
|
||||||
//!
|
//!
|
||||||
@@ -930,7 +930,7 @@ class vector
|
|||||||
const size_type input_sz = static_cast<size_type>(std::distance(first, last));
|
const size_type input_sz = static_cast<size_type>(std::distance(first, last));
|
||||||
const size_type old_capacity = this->capacity();
|
const size_type old_capacity = this->capacity();
|
||||||
if(input_sz > old_capacity){ //If input range is too big, we need to reallocate
|
if(input_sz > old_capacity){ //If input range is too big, we need to reallocate
|
||||||
size_type real_cap;
|
size_type real_cap = 0;
|
||||||
std::pair<pointer, bool> ret =
|
std::pair<pointer, bool> ret =
|
||||||
this->m_holder.allocation_command(allocate_new, input_sz, input_sz, real_cap, this->m_holder.start());
|
this->m_holder.allocation_command(allocate_new, input_sz, input_sz, real_cap, this->m_holder.start());
|
||||||
if(!ret.second){ //New allocation, just emplace new values
|
if(!ret.second){ //New allocation, just emplace new values
|
||||||
@@ -945,7 +945,7 @@ class vector
|
|||||||
this->priv_uninitialized_construct_at_end(first, last);
|
this->priv_uninitialized_construct_at_end(first, last);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
//Forward expansion, use assignment + back deletion/construction that comes later
|
//Forward expansion, use assignment + back deletion/construction that comes later
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1426,7 +1426,7 @@ class vector
|
|||||||
#else
|
#else
|
||||||
BOOST_MOVE_CONVERSION_AWARE_CATCH(push_back, T, void, priv_push_back)
|
BOOST_MOVE_CONVERSION_AWARE_CATCH(push_back, T, void, priv_push_back)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
|
#if defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
|
||||||
//! <b>Requires</b>: position must be a valid iterator of *this.
|
//! <b>Requires</b>: position must be a valid iterator of *this.
|
||||||
//!
|
//!
|
||||||
@@ -2202,7 +2202,7 @@ class vector
|
|||||||
//
|
//
|
||||||
//Old situation:
|
//Old situation:
|
||||||
// first_pos last_pos old_limit
|
// first_pos last_pos old_limit
|
||||||
// | | |
|
// | | |
|
||||||
// ____________V_______V__________________V_____________
|
// ____________V_______V__________________V_____________
|
||||||
//| prefix | range | suffix |raw_mem ~
|
//| prefix | range | suffix |raw_mem ~
|
||||||
//|____________|_______|__________________|_____________~
|
//|____________|_______|__________________|_____________~
|
||||||
@@ -2211,19 +2211,19 @@ class vector
|
|||||||
// range is moved through move assignments
|
// range is moved through move assignments
|
||||||
//
|
//
|
||||||
// first_pos last_pos limit_pos
|
// first_pos last_pos limit_pos
|
||||||
// | | |
|
// | | |
|
||||||
// ____________V_______V__________________V_____________
|
// ____________V_______V__________________V_____________
|
||||||
//| prefix' | | | range |suffix'|raw_mem ~
|
//| prefix' | | | range |suffix'|raw_mem ~
|
||||||
//|________________+______|___^___|_______|_____________~
|
//|________________+______|___^___|_______|_____________~
|
||||||
// | |
|
// | |
|
||||||
// |_>_>_>_>_>^
|
// |_>_>_>_>_>^
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
//New situation in Case B (hole_size > 0):
|
//New situation in Case B (hole_size > 0):
|
||||||
// range is moved through uninitialized moves
|
// range is moved through uninitialized moves
|
||||||
//
|
//
|
||||||
// first_pos last_pos limit_pos
|
// first_pos last_pos limit_pos
|
||||||
// | | |
|
// | | |
|
||||||
// ____________V_______V__________________V________________
|
// ____________V_______V__________________V________________
|
||||||
//| prefix' | | | [hole] | range |
|
//| prefix' | | | [hole] | range |
|
||||||
//|_______________________________________|________|___^___|
|
//|_______________________________________|________|___^___|
|
||||||
@@ -2234,7 +2234,7 @@ class vector
|
|||||||
// range is moved through move assignments and uninitialized moves
|
// range is moved through move assignments and uninitialized moves
|
||||||
//
|
//
|
||||||
// first_pos last_pos limit_pos
|
// first_pos last_pos limit_pos
|
||||||
// | | |
|
// | | |
|
||||||
// ____________V_______V__________________V___
|
// ____________V_______V__________________V___
|
||||||
//| prefix' | | | range |
|
//| prefix' | | | range |
|
||||||
//|___________________________________|___^___|
|
//|___________________________________|___^___|
|
||||||
|
@@ -8,7 +8,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|||||||
<meta http-equiv="refresh" content="0; URL=../../doc/html/container.html">
|
<meta http-equiv="refresh" content="0; URL=../../doc/html/container.html">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
Automatic redirection failed, please go to
|
Automatic redirection failed, please go to
|
||||||
<a href="../../doc/html/container.html">../../doc/html/container.html</a>
|
<a href="../../doc/html/container.html">../../doc/html/container.html</a>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -485,7 +485,7 @@ static void internal_multialloc_free(mstate m, boost_cont_memchain *pchain)
|
|||||||
|
|
||||||
/* lcm is an algorithm that calculates the least common multiple of two
|
/* lcm is an algorithm that calculates the least common multiple of two
|
||||||
integers.
|
integers.
|
||||||
|
|
||||||
Pre: A > 0 && B > 0
|
Pre: A > 0 && B > 0
|
||||||
Recommended: A > B*/
|
Recommended: A > B*/
|
||||||
#define CALCULATE_LCM(A, B, OUT)\
|
#define CALCULATE_LCM(A, B, OUT)\
|
||||||
@@ -520,7 +520,7 @@ static int calculate_lcm_and_needs_backwards_lcmed
|
|||||||
|
|
||||||
lcm = max;
|
lcm = max;
|
||||||
/*If we want to use minbytes data to get a buffer between maxbytes
|
/*If we want to use minbytes data to get a buffer between maxbytes
|
||||||
and minbytes if maxbytes can't be achieved, calculate the
|
and minbytes if maxbytes can't be achieved, calculate the
|
||||||
biggest of all possibilities*/
|
biggest of all possibilities*/
|
||||||
current_forward = GET_TRUNCATED_PO2_SIZE(received_size, backwards_multiple);
|
current_forward = GET_TRUNCATED_PO2_SIZE(received_size, backwards_multiple);
|
||||||
needs_backwards = size_to_achieve - current_forward;
|
needs_backwards = size_to_achieve - current_forward;
|
||||||
@@ -578,7 +578,7 @@ static int calculate_lcm_and_needs_backwards_lcmed
|
|||||||
else{
|
else{
|
||||||
CALCULATE_LCM(max, min, lcm);
|
CALCULATE_LCM(max, min, lcm);
|
||||||
/*If we want to use minbytes data to get a buffer between maxbytes
|
/*If we want to use minbytes data to get a buffer between maxbytes
|
||||||
and minbytes if maxbytes can't be achieved, calculate the
|
and minbytes if maxbytes can't be achieved, calculate the
|
||||||
biggest of all possibilities*/
|
biggest of all possibilities*/
|
||||||
current_forward = GET_TRUNCATED_SIZE(received_size, backwards_multiple);
|
current_forward = GET_TRUNCATED_SIZE(received_size, backwards_multiple);
|
||||||
needs_backwards = size_to_achieve - current_forward;
|
needs_backwards = size_to_achieve - current_forward;
|
||||||
@@ -682,7 +682,7 @@ static void *internal_grow_both_sides
|
|||||||
int prev_was_dv = prev == m->dv;
|
int prev_was_dv = prev == m->dv;
|
||||||
|
|
||||||
assert(newprevsize >= MIN_CHUNK_SIZE);
|
assert(newprevsize >= MIN_CHUNK_SIZE);
|
||||||
|
|
||||||
if (prev_was_dv) {
|
if (prev_was_dv) {
|
||||||
m->dvsize = newprevsize;
|
m->dvsize = newprevsize;
|
||||||
}
|
}
|
||||||
@@ -691,7 +691,7 @@ static void *internal_grow_both_sides
|
|||||||
insert_chunk(m, prev, newprevsize);
|
insert_chunk(m, prev, newprevsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
set_size_and_pinuse_of_free_chunk(prev, newprevsize);
|
set_size_and_pinuse_of_free_chunk(prev, newprevsize);
|
||||||
clear_pinuse(r);
|
clear_pinuse(r);
|
||||||
set_inuse(m, r, rsize);
|
set_inuse(m, r, rsize);
|
||||||
check_malloced_chunk(m, chunk2mem(r), rsize);
|
check_malloced_chunk(m, chunk2mem(r), rsize);
|
||||||
@@ -762,7 +762,7 @@ static int internal_mmap_shrink_in_place(mstate m, mchunkptr oldp, size_t nbmin,
|
|||||||
if(!do_commit){
|
if(!do_commit){
|
||||||
const int flags = 0; /* placate people compiling -Wunused */
|
const int flags = 0; /* placate people compiling -Wunused */
|
||||||
char* cp = (char*)CALL_MREMAP((char*)oldp - offset,
|
char* cp = (char*)CALL_MREMAP((char*)oldp - offset,
|
||||||
oldmmsize, newmmsize, flags);
|
oldmmsize, newmmsize, flags);
|
||||||
/*This must always succeed */
|
/*This must always succeed */
|
||||||
if(!cp){
|
if(!cp){
|
||||||
USAGE_ERROR_ACTION(m, m);
|
USAGE_ERROR_ACTION(m, m);
|
||||||
@@ -822,7 +822,7 @@ static int internal_shrink(mstate m, void* oldmem, size_t minbytes, size_t maxby
|
|||||||
ok_next(oldp, next) && ok_pinuse(next))) {
|
ok_next(oldp, next) && ok_pinuse(next))) {
|
||||||
size_t nbmin = request2size(minbytes);
|
size_t nbmin = request2size(minbytes);
|
||||||
size_t nbmax = request2size(maxbytes);
|
size_t nbmax = request2size(maxbytes);
|
||||||
|
|
||||||
if (nbmin > oldsize){
|
if (nbmin > oldsize){
|
||||||
/* Return error if old size is too small */
|
/* Return error if old size is too small */
|
||||||
}
|
}
|
||||||
@@ -880,8 +880,8 @@ static int internal_node_multialloc
|
|||||||
if( !element_size ||
|
if( !element_size ||
|
||||||
/*OR Error if n_elements less thatn contiguous_elements */
|
/*OR Error if n_elements less thatn contiguous_elements */
|
||||||
((contiguous_elements + 1) > (DL_MULTIALLOC_DEFAULT_CONTIGUOUS + 1) && n_elements < contiguous_elements) ||
|
((contiguous_elements + 1) > (DL_MULTIALLOC_DEFAULT_CONTIGUOUS + 1) && n_elements < contiguous_elements) ||
|
||||||
/* OR Error if integer overflow */
|
/* OR Error if integer overflow */
|
||||||
(SQRT_MAX_SIZE_T < (element_req_size | contiguous_elements) &&
|
(SQRT_MAX_SIZE_T < (element_req_size | contiguous_elements) &&
|
||||||
(MAX_SIZE_T/element_req_size) < contiguous_elements)){
|
(MAX_SIZE_T/element_req_size) < contiguous_elements)){
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1201,7 +1201,7 @@ BOOST_CONTAINER_DECL boost_cont_malloc_stats_t boost_cont_malloc_stats()
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
boost_cont_malloc_stats_t r = { 0, 0, 0 };
|
boost_cont_malloc_stats_t r = { 0, 0, 0 };
|
||||||
USAGE_ERROR_ACTION(ms,ms);
|
USAGE_ERROR_ACTION(ms,ms);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -28,7 +28,7 @@ bool basic_test()
|
|||||||
|
|
||||||
if(boost_cont_all_deallocated())
|
if(boost_cont_all_deallocated())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
boost_cont_grow(ptr, received + 20, received + 30, &received);
|
boost_cont_grow(ptr, received + 20, received + 30, &received);
|
||||||
|
|
||||||
if(boost_cont_allocated_memory() != boost_cont_chunksize(ptr))
|
if(boost_cont_allocated_memory() != boost_cont_chunksize(ptr))
|
||||||
|
@@ -83,7 +83,7 @@ bool test_allocation()
|
|||||||
}
|
}
|
||||||
if(!boost_cont_all_deallocated())
|
if(!boost_cont_all_deallocated())
|
||||||
return false;
|
return false;
|
||||||
//bool ok = free_memory == a.get_free_memory() &&
|
//bool ok = free_memory == a.get_free_memory() &&
|
||||||
//a.all_memory_deallocated() && a.check_sanity();
|
//a.all_memory_deallocated() && a.check_sanity();
|
||||||
//if(!ok) return ok;
|
//if(!ok) return ok;
|
||||||
}
|
}
|
||||||
@@ -137,7 +137,7 @@ bool test_allocation_shrink()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Deallocate it in non sequential order
|
//Deallocate it in non sequential order
|
||||||
for(int j = 0, max = (int)buffers.size()
|
for(int j = 0, max = (int)buffers.size()
|
||||||
;j < max
|
;j < max
|
||||||
@@ -187,7 +187,7 @@ bool test_allocation_expand()
|
|||||||
preferred_size = min_size*2;
|
preferred_size = min_size*2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Deallocate it in non sequential order
|
//Deallocate it in non sequential order
|
||||||
for(int j = 0, max = (int)buffers.size()
|
for(int j = 0, max = (int)buffers.size()
|
||||||
;j < max
|
;j < max
|
||||||
@@ -262,7 +262,7 @@ bool test_allocation_shrink_and_expand()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Deallocate it in non sequential order
|
//Deallocate it in non sequential order
|
||||||
for(int j = 0, max = (int)buffers.size()
|
for(int j = 0, max = (int)buffers.size()
|
||||||
;j < max
|
;j < max
|
||||||
@@ -328,7 +328,7 @@ bool test_allocation_deallocation_expand()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Now erase null values from the vector
|
//Now erase null values from the vector
|
||||||
buffers.erase(std::remove(buffers.begin(), buffers.end(), (void*)0)
|
buffers.erase(std::remove(buffers.begin(), buffers.end(), (void*)0)
|
||||||
,buffers.end());
|
,buffers.end());
|
||||||
@@ -366,7 +366,7 @@ bool test_allocation_with_reuse()
|
|||||||
break;
|
break;
|
||||||
buffers.push_back(ptr);
|
buffers.push_back(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Now deallocate all except the latest
|
//Now deallocate all except the latest
|
||||||
//Now try to expand to the double of the size
|
//Now try to expand to the double of the size
|
||||||
for(int i = 0, max = (int)buffers.size() - 1
|
for(int i = 0, max = (int)buffers.size() - 1
|
||||||
@@ -421,7 +421,7 @@ bool test_aligned_allocation()
|
|||||||
if(!ptr){
|
if(!ptr){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(((std::size_t)ptr & (j - 1)) != 0)
|
if(((std::size_t)ptr & (j - 1)) != 0)
|
||||||
return false;
|
return false;
|
||||||
boost_cont_free(ptr);
|
boost_cont_free(ptr);
|
||||||
@@ -455,7 +455,7 @@ bool test_continuous_aligned_allocation()
|
|||||||
continue_loop = false;
|
continue_loop = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(((std::size_t)ptr & (j - 1)) != 0)
|
if(((std::size_t)ptr & (j - 1)) != 0)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -576,7 +576,7 @@ bool test_many_equal_allocation()
|
|||||||
buffers2.erase(buffers2.begin()+pos);
|
buffers2.erase(buffers2.begin()+pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
//bool ok = free_memory == a.get_free_memory() &&
|
//bool ok = free_memory == a.get_free_memory() &&
|
||||||
//a.all_memory_deallocated() && a.check_sanity();
|
//a.all_memory_deallocated() && a.check_sanity();
|
||||||
//if(!ok) return ok;
|
//if(!ok) return ok;
|
||||||
}
|
}
|
||||||
@@ -684,7 +684,7 @@ bool test_many_different_allocation()
|
|||||||
buffers2.erase(buffers2.begin()+pos);
|
buffers2.erase(buffers2.begin()+pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
//bool ok = free_memory == a.get_free_memory() &&
|
//bool ok = free_memory == a.get_free_memory() &&
|
||||||
//a.all_memory_deallocated() && a.check_sanity();
|
//a.all_memory_deallocated() && a.check_sanity();
|
||||||
//if(!ok) return ok;
|
//if(!ok) return ok;
|
||||||
}
|
}
|
||||||
|
@@ -25,7 +25,7 @@ namespace test{
|
|||||||
template< class T1, class T2>
|
template< class T1, class T2>
|
||||||
bool CheckEqual( const T1 &t1, const T2 &t2
|
bool CheckEqual( const T1 &t1, const T2 &t2
|
||||||
, typename boost::container::container_detail::enable_if_c
|
, typename boost::container::container_detail::enable_if_c
|
||||||
<!boost::container::container_detail::is_pair<T1>::value &&
|
<!boost::container::container_detail::is_pair<T1>::value &&
|
||||||
!boost::container::container_detail::is_pair<T2>::value
|
!boost::container::container_detail::is_pair<T2>::value
|
||||||
>::type* = 0)
|
>::type* = 0)
|
||||||
{ return t1 == t2; }
|
{ return t1 == t2; }
|
||||||
@@ -50,7 +50,7 @@ bool CheckEqualIt( const T1 &i1, const T2 &i2, const C1 &c1, const C2 &c2 )
|
|||||||
template< class Pair1, class Pair2>
|
template< class Pair1, class Pair2>
|
||||||
bool CheckEqual( const Pair1 &pair1, const Pair2 &pair2
|
bool CheckEqual( const Pair1 &pair1, const Pair2 &pair2
|
||||||
, typename boost::container::container_detail::enable_if_c
|
, typename boost::container::container_detail::enable_if_c
|
||||||
<boost::container::container_detail::is_pair<Pair1>::value &&
|
<boost::container::container_detail::is_pair<Pair1>::value &&
|
||||||
boost::container::container_detail::is_pair<Pair2>::value
|
boost::container::container_detail::is_pair<Pair2>::value
|
||||||
>::type* = 0)
|
>::type* = 0)
|
||||||
{
|
{
|
||||||
|
@@ -288,11 +288,11 @@ bool do_test()
|
|||||||
|
|
||||||
cntdeque->resize(100);
|
cntdeque->resize(100);
|
||||||
stddeque->resize(100);
|
stddeque->resize(100);
|
||||||
if(!test::CheckEqualContainers(cntdeque, stddeque)) return 1;
|
if(!test::CheckEqualContainers(cntdeque, stddeque)) return 1;
|
||||||
|
|
||||||
cntdeque->resize(200);
|
cntdeque->resize(200);
|
||||||
stddeque->resize(200);
|
stddeque->resize(200);
|
||||||
if(!test::CheckEqualContainers(cntdeque, stddeque)) return 1;
|
if(!test::CheckEqualContainers(cntdeque, stddeque)) return 1;
|
||||||
|
|
||||||
delete cntdeque;
|
delete cntdeque;
|
||||||
delete stddeque;
|
delete stddeque;
|
||||||
@@ -304,7 +304,7 @@ bool do_test()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
BOOST_CATCH_END
|
BOOST_CATCH_END
|
||||||
|
|
||||||
std::cout << std::endl << "Test OK!" << std::endl;
|
std::cout << std::endl << "Test OK!" << std::endl;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -108,7 +108,7 @@ class expand_bwd_test_allocator
|
|||||||
{ return m_size; }
|
{ return m_size; }
|
||||||
|
|
||||||
friend void swap(self_t &alloc1, self_t &alloc2)
|
friend void swap(self_t &alloc1, self_t &alloc2)
|
||||||
{
|
{
|
||||||
boost::container::swap_dispatch(alloc1.mp_buffer, alloc2.mp_buffer);
|
boost::container::swap_dispatch(alloc1.mp_buffer, alloc2.mp_buffer);
|
||||||
boost::container::swap_dispatch(alloc1.m_size, alloc2.m_size);
|
boost::container::swap_dispatch(alloc1.m_size, alloc2.m_size);
|
||||||
boost::container::swap_dispatch(alloc1.m_offset, alloc2.m_offset);
|
boost::container::swap_dispatch(alloc1.m_offset, alloc2.m_offset);
|
||||||
@@ -125,7 +125,7 @@ class expand_bwd_test_allocator
|
|||||||
(void)preferred_size; (void)reuse; (void)command;
|
(void)preferred_size; (void)reuse; (void)command;
|
||||||
//This allocator only expands backwards!
|
//This allocator only expands backwards!
|
||||||
assert(m_allocations == 0 || (command & boost::container::expand_bwd));
|
assert(m_allocations == 0 || (command & boost::container::expand_bwd));
|
||||||
|
|
||||||
received_size = limit_size;
|
received_size = limit_size;
|
||||||
|
|
||||||
if(m_allocations == 0){
|
if(m_allocations == 0){
|
||||||
|
@@ -299,7 +299,7 @@ int list_test (bool copied_allocators_equal = true)
|
|||||||
boostlist->splice(boostlist->begin(), otherboostlist);
|
boostlist->splice(boostlist->begin(), otherboostlist);
|
||||||
stdlist->splice(stdlist->begin(), otherstdlist);
|
stdlist->splice(stdlist->begin(), otherstdlist);
|
||||||
if(!CheckEqualContainers(boostlist, stdlist))
|
if(!CheckEqualContainers(boostlist, stdlist))
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
listsize = (int)boostlist->size();
|
listsize = (int)boostlist->size();
|
||||||
|
@@ -229,7 +229,7 @@ class map_propagate_test_wrapper
|
|||||||
< T, T, std::less<T>
|
< T, T, std::less<T>
|
||||||
, typename boost::container::allocator_traits<A>::template
|
, typename boost::container::allocator_traits<A>::template
|
||||||
portable_rebind_alloc< std::pair<const T, T> >::type
|
portable_rebind_alloc< std::pair<const T, T> >::type
|
||||||
//tree_assoc_defaults
|
//tree_assoc_defaults
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
BOOST_COPYABLE_AND_MOVABLE(map_propagate_test_wrapper)
|
BOOST_COPYABLE_AND_MOVABLE(map_propagate_test_wrapper)
|
||||||
|
@@ -110,7 +110,7 @@ int map_test_copyable(boost::container::container_detail::true_type)
|
|||||||
stdmapcopy = *stdmap;
|
stdmapcopy = *stdmap;
|
||||||
boostmmapcopy = *boostmultimap;
|
boostmmapcopy = *boostmultimap;
|
||||||
stdmmapcopy = *stdmultimap;
|
stdmmapcopy = *stdmultimap;
|
||||||
|
|
||||||
if(!CheckEqualContainers(&boostmapcopy, &stdmapcopy))
|
if(!CheckEqualContainers(&boostmapcopy, &stdmapcopy))
|
||||||
return 1;
|
return 1;
|
||||||
if(!CheckEqualContainers(&boostmmapcopy, &stdmmapcopy))
|
if(!CheckEqualContainers(&boostmmapcopy, &stdmmapcopy))
|
||||||
@@ -145,7 +145,7 @@ int map_test()
|
|||||||
MyBoostMultiMap *boostmultimap = new MyBoostMultiMap;
|
MyBoostMultiMap *boostmultimap = new MyBoostMultiMap;
|
||||||
MyStdMultiMap *stdmultimap = new MyStdMultiMap;
|
MyStdMultiMap *stdmultimap = new MyStdMultiMap;
|
||||||
|
|
||||||
//Test construction from a range
|
//Test construction from a range
|
||||||
{
|
{
|
||||||
//This is really nasty, but we have no other simple choice
|
//This is really nasty, but we have no other simple choice
|
||||||
IntPairType aux_vect[50];
|
IntPairType aux_vect[50];
|
||||||
@@ -491,7 +491,7 @@ int map_test()
|
|||||||
|
|
||||||
std::pair<typename MyStdMultiMap::iterator, typename MyStdMultiMap::iterator> sret =
|
std::pair<typename MyStdMultiMap::iterator, typename MyStdMultiMap::iterator> sret =
|
||||||
stdmultimap->equal_range(stdmultimap->begin()->first);
|
stdmultimap->equal_range(stdmultimap->begin()->first);
|
||||||
|
|
||||||
if( std::distance(bret.first, bret.second) !=
|
if( std::distance(bret.first, bret.second) !=
|
||||||
std::distance(sret.first, sret.second) ){
|
std::distance(sret.first, sret.second) ){
|
||||||
return 1;
|
return 1;
|
||||||
|
@@ -121,7 +121,7 @@ class movable_and_copyable_int
|
|||||||
movable_and_copyable_int(const movable_and_copyable_int& mmi)
|
movable_and_copyable_int(const movable_and_copyable_int& mmi)
|
||||||
: m_int(mmi.m_int)
|
: m_int(mmi.m_int)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
movable_and_copyable_int(BOOST_RV_REF(movable_and_copyable_int) mmi)
|
movable_and_copyable_int(BOOST_RV_REF(movable_and_copyable_int) mmi)
|
||||||
: m_int(mmi.m_int)
|
: m_int(mmi.m_int)
|
||||||
{ mmi.m_int = 0; }
|
{ mmi.m_int = 0; }
|
||||||
@@ -201,7 +201,7 @@ class copyable_int
|
|||||||
copyable_int(const copyable_int& mmi)
|
copyable_int(const copyable_int& mmi)
|
||||||
: m_int(mmi.m_int)
|
: m_int(mmi.m_int)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
copyable_int & operator= (int i)
|
copyable_int & operator= (int i)
|
||||||
{ this->m_int = i; return *this; }
|
{ this->m_int = i; return *this; }
|
||||||
|
|
||||||
|
@@ -52,7 +52,7 @@ void PrintContainers(MyBoostCont *boostcont, MyStdCont *stdcont)
|
|||||||
std::cout << *itboost << std::endl;
|
std::cout << *itboost << std::endl;
|
||||||
}
|
}
|
||||||
std::cout << "MyStdCont" << std::endl;
|
std::cout << "MyStdCont" << std::endl;
|
||||||
|
|
||||||
for(; itstd != itstdend; ++itstd){
|
for(; itstd != itstdend; ++itstd){
|
||||||
std::cout << *itstd << std::endl;
|
std::cout << *itstd << std::endl;
|
||||||
}
|
}
|
||||||
|
@@ -723,7 +723,7 @@ int main()
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
vector<int, scoped_allocator_adaptor< test_allocator<int, 0> > > dummy;
|
vector<int, scoped_allocator_adaptor< test_allocator<int, 0> > > dummy;
|
||||||
dummy.push_back(0);
|
dummy.push_back(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -238,7 +238,7 @@ struct container_wrapper
|
|||||||
: public Container
|
: public Container
|
||||||
{
|
{
|
||||||
typedef typename Container::allocator_type allocator_type;
|
typedef typename Container::allocator_type allocator_type;
|
||||||
|
|
||||||
container_wrapper(const allocator_type &a)
|
container_wrapper(const allocator_type &a)
|
||||||
: Container(a)
|
: Container(a)
|
||||||
{}
|
{}
|
||||||
|
@@ -205,7 +205,7 @@ void test_move()
|
|||||||
template<class T, class A>
|
template<class T, class A>
|
||||||
class set_propagate_test_wrapper
|
class set_propagate_test_wrapper
|
||||||
: public boost::container::set<T, std::less<T>, A
|
: public boost::container::set<T, std::less<T>, A
|
||||||
//tree_assoc_defaults
|
//tree_assoc_defaults
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
BOOST_COPYABLE_AND_MOVABLE(set_propagate_test_wrapper)
|
BOOST_COPYABLE_AND_MOVABLE(set_propagate_test_wrapper)
|
||||||
|
@@ -99,7 +99,7 @@ int set_test_copyable(boost::container::container_detail::true_type)
|
|||||||
|
|
||||||
boostmsetcopy = *boostmultiset;
|
boostmsetcopy = *boostmultiset;
|
||||||
stdmsetcopy = *stdmultiset;
|
stdmsetcopy = *stdmultiset;
|
||||||
|
|
||||||
if(!CheckEqualContainers(&boostmsetcopy, &stdmsetcopy))
|
if(!CheckEqualContainers(&boostmsetcopy, &stdmsetcopy))
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -128,7 +128,7 @@ int set_test ()
|
|||||||
MyBoostMultiSet *boostmultiset = new MyBoostMultiSet;
|
MyBoostMultiSet *boostmultiset = new MyBoostMultiSet;
|
||||||
MyStdMultiSet *stdmultiset = new MyStdMultiSet;
|
MyStdMultiSet *stdmultiset = new MyStdMultiSet;
|
||||||
|
|
||||||
//Test construction from a range
|
//Test construction from a range
|
||||||
{
|
{
|
||||||
IntType aux_vect[50];
|
IntType aux_vect[50];
|
||||||
for(int i = 0; i < 50; ++i){
|
for(int i = 0; i < 50; ++i){
|
||||||
|
@@ -216,15 +216,15 @@ int string_test()
|
|||||||
boost_swapper.swap(auxBoostString);
|
boost_swapper.swap(auxBoostString);
|
||||||
std_swapper.swap(auxStdString);
|
std_swapper.swap(auxStdString);
|
||||||
if(!StringEqual()(auxBoostString, auxStdString))
|
if(!StringEqual()(auxBoostString, auxStdString))
|
||||||
return 1;
|
return 1;
|
||||||
if(!StringEqual()(boost_swapper, std_swapper))
|
if(!StringEqual()(boost_swapper, std_swapper))
|
||||||
return 1;
|
return 1;
|
||||||
boost_swapper.swap(auxBoostString);
|
boost_swapper.swap(auxBoostString);
|
||||||
std_swapper.swap(auxStdString);
|
std_swapper.swap(auxStdString);
|
||||||
if(!StringEqual()(auxBoostString, auxStdString))
|
if(!StringEqual()(auxBoostString, auxStdString))
|
||||||
return 1;
|
return 1;
|
||||||
if(!StringEqual()(boost_swapper, std_swapper))
|
if(!StringEqual()(boost_swapper, std_swapper))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
//Shrink_to_fit
|
//Shrink_to_fit
|
||||||
auxBoostString.shrink_to_fit();
|
auxBoostString.shrink_to_fit();
|
||||||
@@ -251,7 +251,7 @@ int string_test()
|
|||||||
boost_swapper.swap(auxBoostString);
|
boost_swapper.swap(auxBoostString);
|
||||||
std_swapper.swap(auxStdString);
|
std_swapper.swap(auxStdString);
|
||||||
if(!StringEqual()(auxBoostString, auxStdString))
|
if(!StringEqual()(auxBoostString, auxStdString))
|
||||||
return 1;
|
return 1;
|
||||||
if(!StringEqual()(boost_swapper, std_swapper))
|
if(!StringEqual()(boost_swapper, std_swapper))
|
||||||
return 1;
|
return 1;
|
||||||
boost_swapper.swap(auxBoostString);
|
boost_swapper.swap(auxBoostString);
|
||||||
|
@@ -114,15 +114,15 @@ int vector_test()
|
|||||||
MyStdVector *stdvector = new MyStdVector;
|
MyStdVector *stdvector = new MyStdVector;
|
||||||
boostvector->resize(100);
|
boostvector->resize(100);
|
||||||
stdvector->resize(100);
|
stdvector->resize(100);
|
||||||
if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
|
if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
|
||||||
|
|
||||||
boostvector->resize(200);
|
boostvector->resize(200);
|
||||||
stdvector->resize(200);
|
stdvector->resize(200);
|
||||||
if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
|
if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
|
||||||
|
|
||||||
boostvector->resize(0);
|
boostvector->resize(0);
|
||||||
stdvector->resize(0);
|
stdvector->resize(0);
|
||||||
if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
|
if(!test::CheckEqualContainers(boostvector, stdvector)) return 1;
|
||||||
|
|
||||||
for(int i = 0; i < max; ++i){
|
for(int i = 0; i < max; ++i){
|
||||||
IntType new_int(i);
|
IntType new_int(i);
|
||||||
|
Reference in New Issue
Block a user