Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r86677 - in branches/release: boost boost/circular_buffer libs/circular_buffer
From: antoshkka_at_[hidden]
Date: 2013-11-13 08:30:11


Author: apolukhin
Date: 2013-11-13 08:30:10 EST (Wed, 13 Nov 2013)
New Revision: 86677
URL: http://svn.boost.org/trac/boost/changeset/86677

Log:
Merge circular_buffer from trunk:
* dropped support of antique compilers (thanks to Stephen Kelly for doing it all around the boost!)

Properties modified:
   branches/release/boost/circular_buffer/ (props changed)
   branches/release/boost/circular_buffer.hpp (contents, props changed)
   branches/release/libs/circular_buffer/ (props changed)
Text files modified:
   branches/release/boost/circular_buffer.hpp | 19 +++----------
   branches/release/boost/circular_buffer/base.hpp | 52 ++++++++++------------------------------
   branches/release/boost/circular_buffer/debug.hpp | 2
   branches/release/boost/circular_buffer/details.hpp | 20 --------------
   branches/release/boost/circular_buffer/space_optimized.hpp | 35 +++-----------------------
   5 files changed, 24 insertions(+), 104 deletions(-)

Modified: branches/release/boost/circular_buffer.hpp
==============================================================================
--- branches/release/boost/circular_buffer.hpp Wed Nov 13 07:24:00 2013 (r86676)
+++ branches/release/boost/circular_buffer.hpp 2013-11-13 08:30:10 EST (Wed, 13 Nov 2013) (r86677)
@@ -11,12 +11,13 @@
 #if !defined(BOOST_CIRCULAR_BUFFER_HPP)
 #define BOOST_CIRCULAR_BUFFER_HPP
 
-#if defined(_MSC_VER) && _MSC_VER >= 1200
+#if defined(_MSC_VER)
     #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)
@@ -33,29 +34,20 @@
     #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) || \
- BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+#if BOOST_WORKAROUND(__BORLANDC__, <= 0x0550) || BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
     #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_CB_STATIC_ASSERT((is_convertible<typename detail::iterator_traits<Iterator>::value_type, Type>::value))
+ BOOST_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_CB_STATIC_ASSERT(false);
+ #define BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS BOOST_STATIC_ASSERT(false);
 #else
     #define BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS ((void)0);
 #endif
@@ -67,7 +59,6 @@
 
 #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
 

Modified: branches/release/boost/circular_buffer/base.hpp
==============================================================================
--- branches/release/boost/circular_buffer/base.hpp Wed Nov 13 07:24:00 2013 (r86676)
+++ branches/release/boost/circular_buffer/base.hpp 2013-11-13 08:30:10 EST (Wed, 13 Nov 2013) (r86677)
@@ -12,7 +12,7 @@
 #if !defined(BOOST_CIRCULAR_BUFFER_BASE_HPP)
 #define BOOST_CIRCULAR_BUFFER_BASE_HPP
 
-#if defined(_MSC_VER) && _MSC_VER >= 1200
+#if defined(_MSC_VER)
     #pragma once
 #endif
 
@@ -1150,25 +1150,6 @@
     }
 #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>
@@ -1221,8 +1202,6 @@
         initialize(buffer_capacity, first, last, is_integral<InputIterator>());
     }
 
-#endif // #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
-
     //! The destructor.
     /*!
         Destroys the <code>circular_buffer</code>.
@@ -2554,9 +2533,9 @@
     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, BOOST_ITERATOR_CATEGORY<Iterator>::type());
+ initialize(first, last, iterator_category<Iterator>::type());
 #else
- initialize(first, last, BOOST_DEDUCED_TYPENAME BOOST_ITERATOR_CATEGORY<Iterator>::type());
+ initialize(first, last, BOOST_DEDUCED_TYPENAME iterator_category<Iterator>::type());
 #endif
     }
 
@@ -2593,9 +2572,9 @@
     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, BOOST_ITERATOR_CATEGORY<Iterator>::type());
+ initialize(buffer_capacity, first, last, iterator_category<Iterator>::type());
 #else
- initialize(buffer_capacity, first, last, BOOST_DEDUCED_TYPENAME BOOST_ITERATOR_CATEGORY<Iterator>::type());
+ initialize(buffer_capacity, first, last, BOOST_DEDUCED_TYPENAME iterator_category<Iterator>::type());
 #endif
     }
 
@@ -2687,9 +2666,9 @@
     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, BOOST_ITERATOR_CATEGORY<Iterator>::type());
+ assign(first, last, iterator_category<Iterator>::type());
 #else
- assign(first, last, BOOST_DEDUCED_TYPENAME BOOST_ITERATOR_CATEGORY<Iterator>::type());
+ assign(first, last, BOOST_DEDUCED_TYPENAME iterator_category<Iterator>::type());
 #endif
     }
 
@@ -2724,9 +2703,9 @@
     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, BOOST_ITERATOR_CATEGORY<Iterator>::type());
+ assign(new_capacity, first, last, iterator_category<Iterator>::type());
 #else
- assign(new_capacity, first, last, BOOST_DEDUCED_TYPENAME BOOST_ITERATOR_CATEGORY<Iterator>::type());
+ assign(new_capacity, first, last, BOOST_DEDUCED_TYPENAME iterator_category<Iterator>::type());
 #endif
     }
 
@@ -2737,12 +2716,7 @@
             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);
         }
     }
@@ -2838,9 +2812,9 @@
     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, BOOST_ITERATOR_CATEGORY<Iterator>::type());
+ insert(pos, first, last, iterator_category<Iterator>::type());
 #else
- insert(pos, first, last, BOOST_DEDUCED_TYPENAME BOOST_ITERATOR_CATEGORY<Iterator>::type());
+ insert(pos, first, last, BOOST_DEDUCED_TYPENAME iterator_category<Iterator>::type());
 #endif
     }
 
@@ -2929,9 +2903,9 @@
     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, BOOST_ITERATOR_CATEGORY<Iterator>::type());
+ rinsert(pos, first, last, iterator_category<Iterator>::type());
 #else
- rinsert(pos, first, last, BOOST_DEDUCED_TYPENAME BOOST_ITERATOR_CATEGORY<Iterator>::type());
+ rinsert(pos, first, last, BOOST_DEDUCED_TYPENAME iterator_category<Iterator>::type());
 #endif
     }
 

Modified: branches/release/boost/circular_buffer/debug.hpp
==============================================================================
--- branches/release/boost/circular_buffer/debug.hpp Wed Nov 13 07:24:00 2013 (r86676)
+++ branches/release/boost/circular_buffer/debug.hpp 2013-11-13 08:30:10 EST (Wed, 13 Nov 2013) (r86677)
@@ -9,7 +9,7 @@
 #if !defined(BOOST_CIRCULAR_BUFFER_DEBUG_HPP)
 #define BOOST_CIRCULAR_BUFFER_DEBUG_HPP
 
-#if defined(_MSC_VER) && _MSC_VER >= 1200
+#if defined(_MSC_VER)
     #pragma once
 #endif
 

Modified: branches/release/boost/circular_buffer/details.hpp
==============================================================================
--- branches/release/boost/circular_buffer/details.hpp Wed Nov 13 07:24:00 2013 (r86676)
+++ branches/release/boost/circular_buffer/details.hpp 2013-11-13 08:30:10 EST (Wed, 13 Nov 2013) (r86677)
@@ -9,7 +9,7 @@
 #if !defined(BOOST_CIRCULAR_BUFFER_DETAILS_HPP)
 #define BOOST_CIRCULAR_BUFFER_DETAILS_HPP
 
-#if defined(_MSC_VER) && _MSC_VER >= 1200
+#if defined(_MSC_VER)
     #pragma once
 #endif
 
@@ -423,24 +423,6 @@
     return it + n;
 }
 
-#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR)
-
-//! Iterator category.
-template <class Buff, class Traits>
-inline std::random_access_iterator_tag iterator_category(const iterator<Buff, Traits>&) {
- return std::random_access_iterator_tag();
-}
-
-//! The type of the elements stored in the circular buffer.
-template <class Buff, class Traits>
-inline typename Traits::value_type* value_type(const iterator<Buff, Traits>&) { return 0; }
-
-//! Distance type.
-template <class Buff, class Traits>
-inline typename Traits::difference_type* distance_type(const iterator<Buff, Traits>&) { return 0; }
-
-#endif // #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR)
-
 /*!
     \fn ForwardIterator uninitialized_copy(InputIterator first, InputIterator last, ForwardIterator dest)
     \brief Equivalent of <code>std::uninitialized_copy</code> but with explicit specification of value type.

Modified: branches/release/boost/circular_buffer/space_optimized.hpp
==============================================================================
--- branches/release/boost/circular_buffer/space_optimized.hpp Wed Nov 13 07:24:00 2013 (r86676)
+++ branches/release/boost/circular_buffer/space_optimized.hpp 2013-11-13 08:30:10 EST (Wed, 13 Nov 2013) (r86677)
@@ -11,7 +11,7 @@
 #if !defined(BOOST_CIRCULAR_BUFFER_SPACE_OPTIMIZED_HPP)
 #define BOOST_CIRCULAR_BUFFER_SPACE_OPTIMIZED_HPP
 
-#if defined(_MSC_VER) && _MSC_VER >= 1200
+#if defined(_MSC_VER)
     #pragma once
 #endif
 
@@ -416,31 +416,6 @@
     : 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>.
@@ -534,11 +509,9 @@
         first, last, alloc)
     , m_capacity_ctrl(capacity_ctrl) {
         reduce_capacity(
- is_same< BOOST_DEDUCED_TYPENAME BOOST_ITERATOR_CATEGORY<InputIterator>::type, std::input_iterator_tag >());
+ is_same< BOOST_DEDUCED_TYPENAME 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.
@@ -1632,10 +1605,10 @@
         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, BOOST_ITERATOR_CATEGORY<Iterator>::type());
+ return init_capacity(capacity_ctrl, first, last, iterator_category<Iterator>::type());
 #else
         return init_capacity(
- capacity_ctrl, first, last, BOOST_DEDUCED_TYPENAME BOOST_ITERATOR_CATEGORY<Iterator>::type());
+ capacity_ctrl, first, last, BOOST_DEDUCED_TYPENAME iterator_category<Iterator>::type());
 #endif
     }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk