mirror of
https://github.com/boostorg/circular_buffer.git
synced 2026-02-03 09:02:12 +00:00
Compare commits
5 Commits
boost-1.42
...
boost-1.54
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46c0ad7e6b | ||
|
|
6998f28fda | ||
|
|
ed237fa058 | ||
|
|
2bd298dec7 | ||
|
|
65810242ee |
@@ -65,6 +65,9 @@
|
||||
<dt>
|
||||
<a href="#debug">Debug Support</a>
|
||||
</dt>
|
||||
<dt>
|
||||
<a href="#interprocess">Compatibility with Interprocess library</a>
|
||||
</dt>
|
||||
<dt>
|
||||
<a href="#examples">More Examples</a>
|
||||
</dt>
|
||||
@@ -594,7 +597,18 @@ template <class T, class Alloc>
|
||||
</p>
|
||||
<p>
|
||||
The debug support is enabled only in the debug mode (when the <code>NDEBUG</code> is not defined). It can also be
|
||||
explicitly disabled by defining <code>BOOST_CB_DISABLE_DEBUG</code> macro.
|
||||
explicitly disabled (only for <code>circular_buffer</code>) by defining <code>BOOST_CB_DISABLE_DEBUG</code>
|
||||
macro.
|
||||
</p>
|
||||
<h2>
|
||||
<a name="intreprocess" id="interprocess">Compatibility with Interprocess library</a>
|
||||
</h2>
|
||||
<p>
|
||||
The <code>circular_buffer</code> is compatible with the <a href="../../../doc/html/interprocess.html">Boost
|
||||
Interprocess</a> library used for interprocess communication. Considering that the <code>circular_buffer</code>'s
|
||||
debug support relies on 'raw' pointers - which is not permited by the Interprocess library - the code has to
|
||||
compiled with <code>-DBOOST_CB_DISABLE_DEBUG</code> or <code>-DNDEBUG</code> (which disables the
|
||||
<a href="#debug">Debug Support</a>). Not doing that will cause the compilation to fail.
|
||||
</p>
|
||||
<h2>
|
||||
<a name="examples" id="examples">More Examples</a>
|
||||
|
||||
@@ -34,6 +34,12 @@
|
||||
#include <stddef.h>
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std {
|
||||
using ::memset;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
/*!
|
||||
@@ -2081,7 +2087,7 @@ private:
|
||||
throw_exception(std::length_error("circular_buffer"));
|
||||
#if BOOST_CB_ENABLE_DEBUG
|
||||
pointer p = (n == 0) ? 0 : m_alloc.allocate(n, 0);
|
||||
::memset(p, cb_details::UNINITIALIZED, sizeof(value_type) * n);
|
||||
std::memset(p, cb_details::UNINITIALIZED, sizeof(value_type) * n);
|
||||
return p;
|
||||
#else
|
||||
return (n == 0) ? 0 : m_alloc.allocate(n, 0);
|
||||
@@ -2124,7 +2130,7 @@ private:
|
||||
m_alloc.destroy(p);
|
||||
#if BOOST_CB_ENABLE_DEBUG
|
||||
invalidate_iterators(iterator(this, p));
|
||||
::memset(p, cb_details::UNINITIALIZED, sizeof(value_type));
|
||||
std::memset(p, cb_details::UNINITIALIZED, sizeof(value_type));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2310,7 +2316,7 @@ private:
|
||||
}
|
||||
|
||||
//! Specialized method for swapping the allocator.
|
||||
void swap_allocator(circular_buffer<T, Alloc>& cb, const true_type&) {
|
||||
void swap_allocator(circular_buffer<T, Alloc>&, const true_type&) {
|
||||
// Swap is not needed because allocators have no state.
|
||||
}
|
||||
|
||||
|
||||
@@ -1260,11 +1260,7 @@ private:
|
||||
ensure_reserve(new_capacity, new_size));
|
||||
}
|
||||
#if BOOST_CB_ENABLE_DEBUG
|
||||
# if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(70190006))
|
||||
this->invalidate_iterators_except(end());
|
||||
# else
|
||||
invalidate_iterators_except(end());
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1284,11 +1280,7 @@ private:
|
||||
circular_buffer<T, Alloc>::set_capacity(
|
||||
ensure_reserve(new_capacity, size()));
|
||||
#if BOOST_CB_ENABLE_DEBUG
|
||||
# if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(70190006))
|
||||
this->invalidate_iterators_except(end());
|
||||
# else
|
||||
invalidate_iterators_except(end());
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1308,7 +1300,7 @@ private:
|
||||
|
||||
//! Specialized method for determining the initial capacity.
|
||||
template <class IntegralType>
|
||||
static size_type init_capacity(const capacity_type& capacity_ctrl, IntegralType n, IntegralType item,
|
||||
static size_type init_capacity(const capacity_type& capacity_ctrl, IntegralType n, IntegralType,
|
||||
const true_type&) {
|
||||
return init_capacity(capacity_ctrl, static_cast<size_type>(n));
|
||||
}
|
||||
@@ -1328,7 +1320,7 @@ private:
|
||||
|
||||
//! Specialized method for determining the initial capacity.
|
||||
template <class InputIterator>
|
||||
static size_type init_capacity(const capacity_type& capacity_ctrl, InputIterator first, InputIterator last,
|
||||
static size_type init_capacity(const capacity_type& capacity_ctrl, InputIterator, InputIterator,
|
||||
const std::input_iterator_tag&) {
|
||||
return capacity_ctrl.capacity();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user