Mercurial > hg > vamp-build-and-test
diff DEPENDENCIES/generic/include/boost/geometry/index/detail/varray.hpp @ 101:c530137014c0
Update Boost headers (1.58.0)
author | Chris Cannam |
---|---|
date | Mon, 07 Sep 2015 11:12:49 +0100 |
parents | 2665513ce2d3 |
children |
line wrap: on
line diff
--- a/DEPENDENCIES/generic/include/boost/geometry/index/detail/varray.hpp Fri Sep 04 12:01:02 2015 +0100 +++ b/DEPENDENCIES/generic/include/boost/geometry/index/detail/varray.hpp Mon Sep 07 11:12:49 2015 +0100 @@ -1,6 +1,6 @@ // Boost.Container varray // -// Copyright (c) 2012-2013 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2012-2015 Adam Wulkiewicz, Lodz, Poland. // Copyright (c) 2011-2013 Andrew Hundt. // // Use, modification and distribution is subject to the Boost Software License, @@ -13,7 +13,10 @@ // TODO - REMOVE/CHANGE #include <boost/container/detail/config_begin.hpp> #include <boost/container/detail/workaround.hpp> -#include <boost/container/detail/preprocessor.hpp> + +#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) +#include <boost/move/detail/fwd_macros.hpp> +#endif #include <boost/config.hpp> #include <boost/swap.hpp> @@ -32,12 +35,11 @@ #include <boost/iterator/iterator_concepts.hpp> #include <boost/geometry/index/detail/assert.hpp> +#include <boost/geometry/index/detail/exception.hpp> -#include <boost/geometry/index/detail/assert.hpp> #include <boost/geometry/index/detail/varray_detail.hpp> #include <boost/concept_check.hpp> -#include <boost/throw_exception.hpp> /*! \defgroup varray_non_member varray non-member functions @@ -79,12 +81,8 @@ static inline void throw_out_of_bounds(Varray const& v, size_type i) { -//#ifndef BOOST_NO_EXCEPTIONS if ( v.size() <= i ) - BOOST_THROW_EXCEPTION(std::out_of_range("index out of bounds")); -//#else // BOOST_NO_EXCEPTIONS -// BOOST_GEOMETRY_INDEX_ASSERT(i < v.size(), "index out of bounds"); -//#endif // BOOST_NO_EXCEPTIONS + throw_out_of_range("index out of bounds"); ::boost::ignore_unused_variable_warning(v); ::boost::ignore_unused_variable_warning(i); @@ -178,7 +176,7 @@ BOOST_COPYABLE_AND_MOVABLE(varray) -#ifdef BOOST_NO_RVALUE_REFERENCES +#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES public: template <std::size_t C> varray & operator=(varray<Value, C> & sv) @@ -363,12 +361,7 @@ //! @par Complexity //! Linear O(N). template <std::size_t C> -// TEMPORARY WORKAROUND -#if defined(BOOST_NO_RVALUE_REFERENCES) - varray & operator=(::boost::rv< varray<value_type, C> > const& other) -#else - varray & operator=(varray<value_type, C> const& other) -#endif + varray & operator=(BOOST_COPY_ASSIGN_REF_2_TEMPL_ARGS(varray, value_type, C) other) { this->assign(other.begin(), other.end()); // may throw @@ -925,9 +918,9 @@ difference_type n = std::distance(first, last); //TODO - add invalid range check? - //BOOST_ASSERT_MSG(0 <= n, "invalid range"); + //BOOST_GEOMETRY_INDEX_ASSERT(0 <= n, "invalid range"); //TODO - add this->size() check? - //BOOST_ASSERT_MSG(n <= this->size(), "invalid range"); + //BOOST_GEOMETRY_INDEX_ASSERT(n <= this->size(), "invalid range"); sv::move(last, this->end(), first); // may throw sv::destroy(this->end() - n, this->end()); @@ -989,7 +982,7 @@ } #if !defined(BOOST_CONTAINER_VARRAY_DISABLE_EMPLACE) -#if defined(BOOST_CONTAINER_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED) +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED) //! @pre <tt>size() < capacity()</tt> //! //! @brief Inserts a Value constructed with @@ -1070,27 +1063,23 @@ return position; } -#else // BOOST_CONTAINER_PERFECT_FORWARDING || BOOST_CONTAINER_DOXYGEN_INVOKED +#else // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED) - #define BOOST_PP_LOCAL_MACRO(n) \ - BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ - void emplace_back(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + #define BOOST_GEOMETRY_INDEX_DETAIL_VARRAY_EMPLACE(N) \ + BOOST_MOVE_TMPL_LT##N BOOST_MOVE_CLASS##N BOOST_MOVE_GT##N \ + void emplace_back(BOOST_MOVE_UREF##N) \ { \ typedef typename vt::disable_trivial_init dti; \ \ errh::check_capacity(*this, m_size + 1); /*may throw*/\ \ - namespace sv = varray_detail; \ - sv::construct(dti(), this->end() BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) ); /*may throw*/\ + namespace sv = varray_detail; \ + sv::construct(dti(), this->end() BOOST_MOVE_I##N BOOST_MOVE_FWD##N ); /*may throw*/\ ++m_size; /*update end*/ \ } \ - // - #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) - #include BOOST_PP_LOCAL_ITERATE() - - #define BOOST_PP_LOCAL_MACRO(n) \ - BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \ - iterator emplace(iterator position BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \ + \ + BOOST_MOVE_TMPL_LT##N BOOST_MOVE_CLASS##N BOOST_MOVE_GT##N \ + iterator emplace(iterator position BOOST_MOVE_I##N BOOST_MOVE_UREF##N) \ { \ typedef typename vt::disable_trivial_init dti; \ namespace sv = varray_detail; \ @@ -1100,7 +1089,7 @@ \ if ( position == this->end() ) \ { \ - sv::construct(dti(), position BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) ); /*may throw*/\ + sv::construct(dti(), position BOOST_MOVE_I##N BOOST_MOVE_FWD##N ); /*may throw*/\ ++m_size; /*update end*/ \ } \ else \ @@ -1109,24 +1098,24 @@ /* TODO - should move be used only if it's nonthrowing? */ \ \ value_type & r = *(this->end() - 1); \ - sv::construct(dti(), this->end(), boost::move(r)); /*may throw*/\ + sv::construct(dti(), this->end(), boost::move(r)); /*may throw*/\ ++m_size; /*update end*/ \ sv::move_backward(position, this->end() - 2, this->end() - 1); /*may throw*/\ \ aligned_storage<sizeof(value_type), alignment_of<value_type>::value> temp_storage; \ value_type * val_p = static_cast<value_type *>(temp_storage.address()); \ - sv::construct(dti(), val_p BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) ); /*may throw*/\ + sv::construct(dti(), val_p BOOST_MOVE_I##N BOOST_MOVE_FWD##N ); /*may throw*/\ sv::scoped_destructor<value_type> d(val_p); \ sv::assign(position, ::boost::move(*val_p)); /*may throw*/\ } \ \ return position; \ } \ - // - #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) - #include BOOST_PP_LOCAL_ITERATE() + + BOOST_MOVE_ITERATE_0TO9(BOOST_GEOMETRY_INDEX_DETAIL_VARRAY_EMPLACE) + #undef BOOST_GEOMETRY_INDEX_DETAIL_VARRAY_EMPLACE -#endif // BOOST_CONTAINER_PERFECT_FORWARDING || BOOST_CONTAINER_DOXYGEN_INVOKED +#endif // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED) #endif // !BOOST_CONTAINER_VARRAY_DISABLE_EMPLACE //! @brief Removes all elements from the container. @@ -1411,7 +1400,7 @@ //! //! @par Complexity //! Constant O(1). - const_reverse_iterator rbegin() const { return reverse_iterator(this->end()); } + const_reverse_iterator rbegin() const { return const_reverse_iterator(this->end()); } //! @brief Returns const reverse iterator to the first element of the reversed container. //! @@ -1423,7 +1412,7 @@ //! //! @par Complexity //! Constant O(1). - const_reverse_iterator crbegin() const { return reverse_iterator(this->end()); } + const_reverse_iterator crbegin() const { return const_reverse_iterator(this->end()); } //! @brief Returns reverse iterator to the one after the last element of the reversed container. //! @@ -1447,7 +1436,7 @@ //! //! @par Complexity //! Constant O(1). - const_reverse_iterator rend() const { return reverse_iterator(this->begin()); } + const_reverse_iterator rend() const { return const_reverse_iterator(this->begin()); } //! @brief Returns const reverse iterator to the one after the last element of the reversed container. //! @@ -1459,7 +1448,7 @@ //! //! @par Complexity //! Constant O(1). - const_reverse_iterator crend() const { return reverse_iterator(this->begin()); } + const_reverse_iterator crend() const { return const_reverse_iterator(this->begin()); } //! @brief Returns container's capacity. //! @@ -1619,7 +1608,8 @@ // Linear O(N). void swap_dispatch_impl(iterator first_sm, iterator last_sm, iterator first_la, iterator last_la, boost::true_type const& /*use_memop*/) { - //BOOST_ASSERT_MSG(std::distance(first_sm, last_sm) <= std::distance(first_la, last_la)); + //BOOST_GEOMETRY_INDEX_ASSERT(std::distance(first_sm, last_sm) <= std::distance(first_la, last_la), + // "incompatible ranges"); namespace sv = varray_detail; for (; first_sm != last_sm ; ++first_sm, ++first_la) @@ -1644,7 +1634,8 @@ // Linear O(N). void swap_dispatch_impl(iterator first_sm, iterator last_sm, iterator first_la, iterator last_la, boost::false_type const& /*use_memop*/) { - //BOOST_ASSERT_MSG(std::distance(first_sm, last_sm) <= std::distance(first_la, last_la)); + //BOOST_GEOMETRY_INDEX_ASSERT(std::distance(first_sm, last_sm) <= std::distance(first_la, last_la), + // "incompatible ranges"); namespace sv = varray_detail; for (; first_sm != last_sm ; ++first_sm, ++first_la) @@ -1951,7 +1942,6 @@ void insert(iterator, Iterator first, Iterator last) { // TODO - add MPL_ASSERT, check if Iterator is really an iterator - typedef typename boost::iterator_traversal<Iterator>::type traversal; errh::check_capacity(*this, std::distance(first, last)); // may throw } @@ -1967,7 +1957,7 @@ errh::check_iterator_end_eq(*this, first); errh::check_iterator_end_eq(*this, last); - //BOOST_ASSERT_MSG(0 <= n, "invalid range"); + //BOOST_GEOMETRY_INDEX_ASSERT(0 <= n, "invalid range"); } // basic @@ -1975,7 +1965,6 @@ void assign(Iterator first, Iterator last) { // TODO - add MPL_ASSERT, check if Iterator is really an iterator - typedef typename boost::iterator_traversal<Iterator>::type traversal; errh::check_capacity(*this, std::distance(first, last)); // may throw }