Compare commits

...

24 Commits

Author SHA1 Message Date
Marshall Clow
aca434d344 Release 1.55.0
[SVN r86621]
2013-11-11 19:45:21 +00:00
Daniel James
90711fb1fe Merge circular buffer documentation fixes.
[SVN r86209]
2013-10-08 21:01:18 +00:00
Antony Polukhin
6eb5fd4a3d Big merge of Boost.CircularBuffer :
* Full merge of QuickBoock documentation from Paul A. Bristow
* Merged rvalue references support with tests and documentation (fixed #7888)

[SVN r85510]
2013-08-29 08:39:09 +00:00
Marshall Clow
6998f28fda Apply patch to release branch; Fixes #8032
[SVN r84450]
2013-05-23 18:45:31 +00:00
Jan Gaspar
ed237fa058 circular_buffer: fixed when BOOST_NO_STDC_NAMESPACE defined
[SVN r66704]
2010-11-23 19:45:36 +00:00
Jan Gaspar
2bd298dec7 circular_buffer: applied patch to remove workaround for DEC C++ compiler - now all compilers will use this->invalidate_iterators_except
[SVN r61570]
2010-04-26 09:40:08 +00:00
Jan Gaspar
65810242ee circular_buffer: updated documentation
[SVN r60691]
2010-03-18 12:39:52 +00:00
Jan Gaspar
0282b8ee74 circular_buffer: constant complexity of clear method and destructor; added erase_begin and erase_end methods
[SVN r58681]
2010-01-04 15:54:37 +00:00
Troy D. Straszheim
cde2abac0c rm cmake from the release branch before it goes out broken. Policy dictates that you never commit to release, you commit to trunk and merge to release.
[SVN r56941]
2009-10-17 01:10:45 +00:00
Jan Gaspar
f2247e1b9b circular_buffer: #3285
[SVN r55260]
2009-07-29 13:20:21 +00:00
Troy D. Straszheim
d532095822 Add basic copyright/license to keep cmake out of the inspection report
[SVN r55095]
2009-07-22 21:51:01 +00:00
Jan Gaspar
5f566ba7bc circular_buffer: #2785, #3032
[SVN r53652]
2009-06-05 10:33:11 +00:00
Jeremiah Willcock
5aa54f6045 Fixed almost all tab and min/max issues found by inspect tool
[SVN r53142]
2009-05-20 19:41:20 +00:00
Douglas Gregor
8377fd145e Circular_buffer depends on Thread
[SVN r52817]
2009-05-07 04:42:14 +00:00
Troy D. Straszheim
92c290536e merge of cmake build files from trunk per beman
[SVN r50756]
2009-01-24 18:57:20 +00:00
Jan Gaspar
8a115a066a circular_buffer: #2538 Warning suppression in circular buffer test jamfile
[SVN r50107]
2008-12-04 09:09:48 +00:00
Jan Gaspar
491fd3d0ff circular_buffer: fixed MSVC9 warning
[SVN r48264]
2008-08-20 16:13:07 +00:00
Jan Gaspar
6647c9d40f circular_buffer: major update for Boost 1.37
[SVN r48190]
2008-08-18 08:54:04 +00:00
Thorsten Jørgen Ottosen
fb1828e57a default constructor changed so it does not allocate memory (it allocated a huge memory block previously).
[SVN r47559]
2008-07-18 14:18:57 +00:00
Jan Gaspar
c3fcf1a048 circular_buffer: improved documentation
[SVN r43720]
2008-03-19 09:25:52 +00:00
Jan Gaspar
683ca2a581 circular_buffer: bugfix #1692
[SVN r43711]
2008-03-18 22:40:50 +00:00
Jan Gaspar
3ae88fcec8 circular_buffer: updated documentation
[SVN r42942]
2008-01-23 23:36:38 +00:00
Beman Dawes
cf49e405d9 Full merge from trunk at revision 41356 of entire boost-root tree.
[SVN r41370]
2007-11-25 18:38:02 +00:00
Beman Dawes
ee98eb933a Full merge from trunk at revision 41356 of entire boost-root tree.
[SVN r41369]
2007-11-25 18:07:19 +00:00
7 changed files with 88 additions and 26 deletions

View File

@@ -307,7 +307,7 @@ This leads us to the following situation:
* If `value` has a throwing move constructor and some copy constructor, then method may throw exceptions of copy constructor.
* If `value` has no copy constructor, then method may throw exceptions of move constructor.
`move_if_noexcept(T&)` uses [@boost:libs/move/doc/html/move.html Boost.Move], [@boost:libs/type_traits/doc/html/boost_typetraits/reference/is_copy_constructible.html `is_copy_constructible`], [@boost:libs/type_traits/doc/html/boost_typetraits/reference/is_nothrow_move_assignable.html `is_nothrow_move_assignable`] and [@boost:libs/type_traits/doc/html/boost_typetraits/reference/is_nothrow_move_constructible.html `is_nothrow_move_constructible`] type triats.
`move_if_noexcept(T&)` uses [@boost:libs/move/index.html Boost.Move], [@boost:libs/type_traits/doc/html/boost_typetraits/reference/is_copy_constructible.html `is_copy_constructible`], [@boost:libs/type_traits/doc/html/boost_typetraits/reference/is_nothrow_move_assignable.html `is_nothrow_move_assignable`] and [@boost:libs/type_traits/doc/html/boost_typetraits/reference/is_nothrow_move_constructible.html `is_nothrow_move_constructible`] type triats.
[h3 Caveats]

View File

@@ -11,13 +11,12 @@
#if !defined(BOOST_CIRCULAR_BUFFER_HPP)
#define BOOST_CIRCULAR_BUFFER_HPP
#if defined(_MSC_VER)
#if defined(_MSC_VER) && _MSC_VER >= 1200
#pragma once
#endif
#include <boost/circular_buffer_fwd.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/static_assert.hpp>
// BOOST_CB_ENABLE_DEBUG: Debug support control.
#if defined(NDEBUG) || defined(BOOST_CB_DISABLE_DEBUG)
@@ -34,20 +33,29 @@
#define BOOST_CB_ASSERT(Expr) ((void)0)
#endif
// BOOST_CB_STATIC_ASSERT: Compile time assertion.
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
#define BOOST_CB_STATIC_ASSERT(Expr) ((void)0)
#else
#include <boost/static_assert.hpp>
#define BOOST_CB_STATIC_ASSERT(Expr) BOOST_STATIC_ASSERT(Expr)
#endif
// BOOST_CB_IS_CONVERTIBLE: Check if Iterator::value_type is convertible to Type.
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x0550) || BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x0550) || BOOST_WORKAROUND(__MWERKS__, <= 0x2407) || \
BOOST_WORKAROUND(BOOST_MSVC, < 1300)
#define BOOST_CB_IS_CONVERTIBLE(Iterator, Type) ((void)0)
#else
#include <boost/detail/iterator.hpp>
#include <boost/type_traits/is_convertible.hpp>
#define BOOST_CB_IS_CONVERTIBLE(Iterator, Type) \
BOOST_STATIC_ASSERT((is_convertible<typename detail::iterator_traits<Iterator>::value_type, Type>::value))
BOOST_CB_STATIC_ASSERT((is_convertible<typename detail::iterator_traits<Iterator>::value_type, Type>::value))
#endif
// BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS:
// Check if the STL provides templated iterator constructors for its containers.
#if defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)
#define BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS BOOST_STATIC_ASSERT(false);
#define BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS BOOST_CB_STATIC_ASSERT(false);
#else
#define BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS ((void)0);
#endif
@@ -59,6 +67,7 @@
#undef BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS
#undef BOOST_CB_IS_CONVERTIBLE
#undef BOOST_CB_STATIC_ASSERT
#undef BOOST_CB_ASSERT
#undef BOOST_CB_ENABLE_DEBUG

View File

@@ -12,7 +12,7 @@
#if !defined(BOOST_CIRCULAR_BUFFER_BASE_HPP)
#define BOOST_CIRCULAR_BUFFER_BASE_HPP
#if defined(_MSC_VER)
#if defined(_MSC_VER) && _MSC_VER >= 1200
#pragma once
#endif
@@ -1150,6 +1150,25 @@ public:
}
#endif // BOOST_NO_CXX11_RVALUE_REFERENCES
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
/*! \cond */
template <class InputIterator>
circular_buffer(InputIterator first, InputIterator last)
: m_alloc(allocator_type()) {
initialize(first, last, is_integral<InputIterator>());
}
template <class InputIterator>
circular_buffer(capacity_type capacity, InputIterator first, InputIterator last)
: m_alloc(allocator_type()) {
initialize(capacity, first, last, is_integral<InputIterator>());
}
/*! \endcond */
#else
//! Create a full <code>circular_buffer</code> filled with a copy of the range.
/*!
\pre Valid range <code>[first, last)</code>.<br>
@@ -1202,6 +1221,8 @@ public:
initialize(buffer_capacity, first, last, is_integral<InputIterator>());
}
#endif // #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
//! The destructor.
/*!
Destroys the <code>circular_buffer</code>.
@@ -2533,9 +2554,9 @@ private:
void initialize(Iterator first, Iterator last, const false_type&) {
BOOST_CB_IS_CONVERTIBLE(Iterator, value_type); // check for invalid iterator type
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581))
initialize(first, last, iterator_category<Iterator>::type());
initialize(first, last, BOOST_ITERATOR_CATEGORY<Iterator>::type());
#else
initialize(first, last, BOOST_DEDUCED_TYPENAME iterator_category<Iterator>::type());
initialize(first, last, BOOST_DEDUCED_TYPENAME BOOST_ITERATOR_CATEGORY<Iterator>::type());
#endif
}
@@ -2572,9 +2593,9 @@ private:
void initialize(capacity_type buffer_capacity, Iterator first, Iterator last, const false_type&) {
BOOST_CB_IS_CONVERTIBLE(Iterator, value_type); // check for invalid iterator type
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581))
initialize(buffer_capacity, first, last, iterator_category<Iterator>::type());
initialize(buffer_capacity, first, last, BOOST_ITERATOR_CATEGORY<Iterator>::type());
#else
initialize(buffer_capacity, first, last, BOOST_DEDUCED_TYPENAME iterator_category<Iterator>::type());
initialize(buffer_capacity, first, last, BOOST_DEDUCED_TYPENAME BOOST_ITERATOR_CATEGORY<Iterator>::type());
#endif
}
@@ -2666,9 +2687,9 @@ private:
void assign(Iterator first, Iterator last, const false_type&) {
BOOST_CB_IS_CONVERTIBLE(Iterator, value_type); // check for invalid iterator type
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581))
assign(first, last, iterator_category<Iterator>::type());
assign(first, last, BOOST_ITERATOR_CATEGORY<Iterator>::type());
#else
assign(first, last, BOOST_DEDUCED_TYPENAME iterator_category<Iterator>::type());
assign(first, last, BOOST_DEDUCED_TYPENAME BOOST_ITERATOR_CATEGORY<Iterator>::type());
#endif
}
@@ -2703,9 +2724,9 @@ private:
void assign(capacity_type new_capacity, Iterator first, Iterator last, const false_type&) {
BOOST_CB_IS_CONVERTIBLE(Iterator, value_type); // check for invalid iterator type
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581))
assign(new_capacity, first, last, iterator_category<Iterator>::type());
assign(new_capacity, first, last, BOOST_ITERATOR_CATEGORY<Iterator>::type());
#else
assign(new_capacity, first, last, BOOST_DEDUCED_TYPENAME iterator_category<Iterator>::type());
assign(new_capacity, first, last, BOOST_DEDUCED_TYPENAME BOOST_ITERATOR_CATEGORY<Iterator>::type());
#endif
}
@@ -2716,7 +2737,12 @@ private:
clear();
insert(begin(), first, last);
} else {
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
circular_buffer<value_type, allocator_type> tmp(new_capacity, m_alloc);
tmp.insert(begin(), first, last);
#else
circular_buffer<value_type, allocator_type> tmp(new_capacity, first, last, m_alloc);
#endif
tmp.swap(*this);
}
}
@@ -2812,9 +2838,9 @@ private:
void insert(const iterator& pos, Iterator first, Iterator last, const false_type&) {
BOOST_CB_IS_CONVERTIBLE(Iterator, value_type); // check for invalid iterator type
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581))
insert(pos, first, last, iterator_category<Iterator>::type());
insert(pos, first, last, BOOST_ITERATOR_CATEGORY<Iterator>::type());
#else
insert(pos, first, last, BOOST_DEDUCED_TYPENAME iterator_category<Iterator>::type());
insert(pos, first, last, BOOST_DEDUCED_TYPENAME BOOST_ITERATOR_CATEGORY<Iterator>::type());
#endif
}
@@ -2903,9 +2929,9 @@ private:
void rinsert(const iterator& pos, Iterator first, Iterator last, const false_type&) {
BOOST_CB_IS_CONVERTIBLE(Iterator, value_type); // check for invalid iterator type
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581))
rinsert(pos, first, last, iterator_category<Iterator>::type());
rinsert(pos, first, last, BOOST_ITERATOR_CATEGORY<Iterator>::type());
#else
rinsert(pos, first, last, BOOST_DEDUCED_TYPENAME iterator_category<Iterator>::type());
rinsert(pos, first, last, BOOST_DEDUCED_TYPENAME BOOST_ITERATOR_CATEGORY<Iterator>::type());
#endif
}

View File

@@ -9,7 +9,7 @@
#if !defined(BOOST_CIRCULAR_BUFFER_DEBUG_HPP)
#define BOOST_CIRCULAR_BUFFER_DEBUG_HPP
#if defined(_MSC_VER)
#if defined(_MSC_VER) && _MSC_VER >= 1200
#pragma once
#endif

View File

@@ -9,7 +9,7 @@
#if !defined(BOOST_CIRCULAR_BUFFER_DETAILS_HPP)
#define BOOST_CIRCULAR_BUFFER_DETAILS_HPP
#if defined(_MSC_VER)
#if defined(_MSC_VER) && _MSC_VER >= 1200
#pragma once
#endif

View File

@@ -11,7 +11,7 @@
#if !defined(BOOST_CIRCULAR_BUFFER_SPACE_OPTIMIZED_HPP)
#define BOOST_CIRCULAR_BUFFER_SPACE_OPTIMIZED_HPP
#if defined(_MSC_VER)
#if defined(_MSC_VER) && _MSC_VER >= 1200
#pragma once
#endif
@@ -416,6 +416,31 @@ public:
: circular_buffer<T, Alloc>(init_capacity(capacity_ctrl, n), n, item, alloc)
, m_capacity_ctrl(capacity_ctrl) {}
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
/*! \cond */
circular_buffer_space_optimized(const circular_buffer_space_optimized<T, Alloc>& cb)
: circular_buffer<T, Alloc>(cb.begin(), cb.end())
, m_capacity_ctrl(cb.m_capacity_ctrl) {}
template <class InputIterator>
circular_buffer_space_optimized(InputIterator first, InputIterator last)
: circular_buffer<T, Alloc>(first, last)
, m_capacity_ctrl(circular_buffer<T, Alloc>::capacity()) {}
template <class InputIterator>
circular_buffer_space_optimized(capacity_type capacity_ctrl, InputIterator first, InputIterator last)
: circular_buffer<T, Alloc>(
init_capacity(capacity_ctrl, first, last, is_integral<InputIterator>()),
first, last)
, m_capacity_ctrl(capacity_ctrl) {
reduce_capacity(
is_same< BOOST_DEDUCED_TYPENAME BOOST_ITERATOR_CATEGORY<InputIterator>::type, std::input_iterator_tag >());
}
/*! \endcond */
#else
//! The copy constructor.
/*!
Creates a copy of the specified <code>circular_buffer_space_optimized</code>.
@@ -509,9 +534,11 @@ public:
first, last, alloc)
, m_capacity_ctrl(capacity_ctrl) {
reduce_capacity(
is_same< BOOST_DEDUCED_TYPENAME iterator_category<InputIterator>::type, std::input_iterator_tag >());
is_same< BOOST_DEDUCED_TYPENAME BOOST_ITERATOR_CATEGORY<InputIterator>::type, std::input_iterator_tag >());
}
#endif // #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
#if defined(BOOST_CB_NEVER_DEFINED)
// This section will never be compiled - the default destructor will be generated instead.
// Declared only for documentation purpose.
@@ -1605,10 +1632,10 @@ private:
const false_type&) {
BOOST_CB_IS_CONVERTIBLE(Iterator, value_type); // check for invalid iterator type
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581))
return init_capacity(capacity_ctrl, first, last, iterator_category<Iterator>::type());
return init_capacity(capacity_ctrl, first, last, BOOST_ITERATOR_CATEGORY<Iterator>::type());
#else
return init_capacity(
capacity_ctrl, first, last, BOOST_DEDUCED_TYPENAME iterator_category<Iterator>::type());
capacity_ctrl, first, last, BOOST_DEDUCED_TYPENAME BOOST_ITERATOR_CATEGORY<Iterator>::type());
#endif
}

View File

@@ -11,7 +11,7 @@
#if !defined(BOOST_CIRCULAR_BUFFER_FWD_HPP)
#define BOOST_CIRCULAR_BUFFER_FWD_HPP
#if defined(_MSC_VER)
#if defined(_MSC_VER) && _MSC_VER >= 1200
#pragma once
#endif