diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2022-08-14 15:19:48 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2022-08-14 15:19:48 +0300 |
commit | 587d76a0f761fa6405b42e0a863ea5d78d2f1dbb (patch) | |
tree | cb213e20159b8fd6a7ef491aad7b08895624a083 | |
parent | ceea7c12ea4fbfcc81981f603bd3eafb731ce5fd (diff) | |
download | ydb-587d76a0f761fa6405b42e0a863ea5d78d2f1dbb.tar.gz |
Update contrib/restricted/boost/multi_array to 1.80.0
18 files changed, 328 insertions, 103 deletions
diff --git a/contrib/restricted/boost/core/include/boost/core/empty_value.hpp b/contrib/restricted/boost/core/include/boost/core/empty_value.hpp new file mode 100644 index 0000000000..9dfd442b9f --- /dev/null +++ b/contrib/restricted/boost/core/include/boost/core/empty_value.hpp @@ -0,0 +1,155 @@ +/* +Copyright 2018 Glen Joseph Fernandes +(glenjofe@gmail.com) + +Distributed under the Boost Software License, Version 1.0. +(http://www.boost.org/LICENSE_1_0.txt) +*/ +#ifndef BOOST_CORE_EMPTY_VALUE_HPP +#define BOOST_CORE_EMPTY_VALUE_HPP + +#include <boost/config.hpp> +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +#include <utility> +#endif + +#if defined(BOOST_GCC_VERSION) && (BOOST_GCC_VERSION >= 40700) +#define BOOST_DETAIL_EMPTY_VALUE_BASE +#elif defined(BOOST_INTEL) && defined(_MSC_VER) && (_MSC_VER >= 1800) +#define BOOST_DETAIL_EMPTY_VALUE_BASE +#elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1800) +#define BOOST_DETAIL_EMPTY_VALUE_BASE +#elif defined(BOOST_CLANG) && !defined(__CUDACC__) +#if __has_feature(is_empty) && __has_feature(is_final) +#define BOOST_DETAIL_EMPTY_VALUE_BASE +#endif +#endif + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4510) +#endif + +namespace boost { + +template<class T> +struct use_empty_value_base { + enum { +#if defined(BOOST_DETAIL_EMPTY_VALUE_BASE) + value = __is_empty(T) && !__is_final(T) +#else + value = false +#endif + }; +}; + +struct empty_init_t { }; + +namespace empty_ { + +template<class T, unsigned N = 0, + bool E = boost::use_empty_value_base<T>::value> +class empty_value { +public: + typedef T type; + +#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) + empty_value() = default; +#else + empty_value() { } +#endif + + empty_value(boost::empty_init_t) + : value_() { } + +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + template<class U, class... Args> + empty_value(boost::empty_init_t, U&& value, Args&&... args) + : value_(std::forward<U>(value), std::forward<Args>(args)...) { } +#else + template<class U> + empty_value(boost::empty_init_t, U&& value) + : value_(std::forward<U>(value)) { } +#endif +#else + template<class U> + empty_value(boost::empty_init_t, const U& value) + : value_(value) { } + + template<class U> + empty_value(boost::empty_init_t, U& value) + : value_(value) { } +#endif + + const T& get() const BOOST_NOEXCEPT { + return value_; + } + + T& get() BOOST_NOEXCEPT { + return value_; + } + +private: + T value_; +}; + +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) +template<class T, unsigned N> +class empty_value<T, N, true> + : T { +public: + typedef T type; + +#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) + empty_value() = default; +#else + empty_value() { } +#endif + + empty_value(boost::empty_init_t) + : T() { } + +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) + template<class U, class... Args> + empty_value(boost::empty_init_t, U&& value, Args&&... args) + : T(std::forward<U>(value), std::forward<Args>(args)...) { } +#else + template<class U> + empty_value(boost::empty_init_t, U&& value) + : T(std::forward<U>(value)) { } +#endif +#else + template<class U> + empty_value(boost::empty_init_t, const U& value) + : T(value) { } + + template<class U> + empty_value(boost::empty_init_t, U& value) + : T(value) { } +#endif + + const T& get() const BOOST_NOEXCEPT { + return *this; + } + + T& get() BOOST_NOEXCEPT { + return *this; + } +}; +#endif + +} /* empty_ */ + +using empty_::empty_value; + +BOOST_INLINE_CONSTEXPR empty_init_t empty_init = empty_init_t(); + +} /* boost */ + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif + +#endif diff --git a/contrib/restricted/boost/multi_array/include/boost/multi_array.hpp b/contrib/restricted/boost/multi_array/include/boost/multi_array.hpp index 44dfab3928..c9ed215bbd 100644 --- a/contrib/restricted/boost/multi_array/include/boost/multi_array.hpp +++ b/contrib/restricted/boost/multi_array/include/boost/multi_array.hpp @@ -1,5 +1,8 @@ // Copyright 2002 The Trustees of Indiana University. +// Copyright 2018 Glen Joseph Fernandes +// (glenjofe@gmail.com) + // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -10,8 +13,8 @@ // Andrew Lumsdaine // See http://www.boost.org/libs/multi_array for documentation. -#ifndef BOOST_MULTI_ARRAY_RG071801_HPP -#define BOOST_MULTI_ARRAY_RG071801_HPP +#ifndef BOOST_MULTI_ARRAY_HPP +#define BOOST_MULTI_ARRAY_HPP // // multi_array.hpp - contains the multi_array class template @@ -30,6 +33,8 @@ #include "boost/multi_array/subarray.hpp" #include "boost/multi_array/multi_array_ref.hpp" #include "boost/multi_array/algorithm.hpp" +#include "boost/core/alloc_construct.hpp" +#include "boost/core/empty_value.hpp" #include "boost/array.hpp" #include "boost/mpl/if.hpp" #include "boost/type_traits.hpp" @@ -114,8 +119,10 @@ struct disable_multi_array_impl<int> template<typename T, std::size_t NumDims, typename Allocator> class multi_array : - public multi_array_ref<T,NumDims> + public multi_array_ref<T,NumDims>, + private boost::empty_value<Allocator> { + typedef boost::empty_value<Allocator> alloc_base; typedef multi_array_ref<T,NumDims> super_type; public: typedef typename super_type::value_type value_type; @@ -142,22 +149,25 @@ public: typedef boost::detail::multi_array::multi_array_view<T,NDims> type; }; - explicit multi_array() : + explicit multi_array(const Allocator& alloc = Allocator()) : super_type((T*)initial_base_,c_storage_order(), - /*index_bases=*/0, /*extents=*/0) { + /*index_bases=*/0, /*extents=*/0), + alloc_base(boost::empty_init_t(),alloc) { allocate_space(); } template <class ExtentList> explicit multi_array( - ExtentList const& extents + ExtentList const& extents, + const Allocator& alloc = Allocator() #ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING , typename mpl::if_< detail::multi_array::is_multi_array_impl<ExtentList>, int&,int>::type* = 0 #endif ) : - super_type((T*)initial_base_,extents) { + super_type((T*)initial_base_,extents), + alloc_base(boost::empty_init_t(),alloc) { boost::function_requires< detail::multi_array::CollectionConcept<ExtentList> >(); allocate_space(); @@ -167,7 +177,8 @@ public: template <class ExtentList> explicit multi_array(ExtentList const& extents, const general_storage_order<NumDims>& so) : - super_type((T*)initial_base_,extents,so) { + super_type((T*)initial_base_,extents,so), + alloc_base(boost::empty_init_t()) { boost::function_requires< detail::multi_array::CollectionConcept<ExtentList> >(); allocate_space(); @@ -177,7 +188,8 @@ public: explicit multi_array(ExtentList const& extents, const general_storage_order<NumDims>& so, Allocator const& alloc) : - super_type((T*)initial_base_,extents,so), allocator_(alloc) { + super_type((T*)initial_base_,extents,so), + alloc_base(boost::empty_init_t(),alloc) { boost::function_requires< detail::multi_array::CollectionConcept<ExtentList> >(); allocate_space(); @@ -185,8 +197,10 @@ public: explicit multi_array(const detail::multi_array - ::extent_gen<NumDims>& ranges) : - super_type((T*)initial_base_,ranges) { + ::extent_gen<NumDims>& ranges, + const Allocator& alloc = Allocator()) : + super_type((T*)initial_base_,ranges), + alloc_base(boost::empty_init_t(),alloc) { allocate_space(); } @@ -195,7 +209,8 @@ public: explicit multi_array(const detail::multi_array ::extent_gen<NumDims>& ranges, const general_storage_order<NumDims>& so) : - super_type((T*)initial_base_,ranges,so) { + super_type((T*)initial_base_,ranges,so), + alloc_base(boost::empty_init_t()) { allocate_space(); } @@ -205,13 +220,15 @@ public: ::extent_gen<NumDims>& ranges, const general_storage_order<NumDims>& so, Allocator const& alloc) : - super_type((T*)initial_base_,ranges,so), allocator_(alloc) { + super_type((T*)initial_base_,ranges,so), + alloc_base(boost::empty_init_t(),alloc) { allocate_space(); } multi_array(const multi_array& rhs) : - super_type(rhs), allocator_(rhs.allocator_) { + super_type(rhs), + alloc_base(static_cast<const alloc_base&>(rhs)) { allocate_space(); boost::detail::multi_array::copy_n(rhs.base_,rhs.num_elements(),base_); } @@ -228,8 +245,10 @@ public: #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING template <typename OPtr> multi_array(const const_multi_array_ref<T,NumDims,OPtr>& rhs, - const general_storage_order<NumDims>& so = c_storage_order()) - : super_type(0,so,rhs.index_bases(),rhs.shape()) + const general_storage_order<NumDims>& so = c_storage_order(), + const Allocator& alloc = Allocator()) + : super_type(0,so,rhs.index_bases(),rhs.shape()), + alloc_base(boost::empty_init_t(),alloc) { allocate_space(); // Warning! storage order may change, hence the following copy technique. @@ -239,8 +258,10 @@ public: template <typename OPtr> multi_array(const detail::multi_array:: const_sub_array<T,NumDims,OPtr>& rhs, - const general_storage_order<NumDims>& so = c_storage_order()) - : super_type(0,so,rhs.index_bases(),rhs.shape()) + const general_storage_order<NumDims>& so = c_storage_order(), + const Allocator& alloc = Allocator()) + : super_type(0,so,rhs.index_bases(),rhs.shape()), + alloc_base(boost::empty_init_t(),alloc) { allocate_space(); std::copy(rhs.begin(),rhs.end(),this->begin()); @@ -250,8 +271,10 @@ public: template <typename OPtr> multi_array(const detail::multi_array:: const_multi_array_view<T,NumDims,OPtr>& rhs, - const general_storage_order<NumDims>& so = c_storage_order()) - : super_type(0,so,rhs.index_bases(),rhs.shape()) + const general_storage_order<NumDims>& so = c_storage_order(), + const Allocator& alloc = Allocator()) + : super_type(0,so,rhs.index_bases(),rhs.shape()), + alloc_base(boost::empty_init_t(),alloc) { allocate_space(); std::copy(rhs.begin(),rhs.end(),this->begin()); @@ -261,8 +284,10 @@ public: // More limited support for MSVC - multi_array(const const_multi_array_ref<T,NumDims>& rhs) - : super_type(0,c_storage_order(),rhs.index_bases(),rhs.shape()) + multi_array(const const_multi_array_ref<T,NumDims>& rhs, + const Allocator& alloc = Allocator()) + : super_type(0,c_storage_order(),rhs.index_bases(),rhs.shape()), + alloc_base(boost::empty_init_t(),alloc) { allocate_space(); // Warning! storage order may change, hence the following copy technique. @@ -270,8 +295,10 @@ public: } multi_array(const const_multi_array_ref<T,NumDims>& rhs, - const general_storage_order<NumDims>& so) - : super_type(0,so,rhs.index_bases(),rhs.shape()) + const general_storage_order<NumDims>& so, + const Allocator& alloc = Allocator()) + : super_type(0,so,rhs.index_bases(),rhs.shape()), + alloc_base(boost::empty_init_t(),alloc) { allocate_space(); // Warning! storage order may change, hence the following copy technique. @@ -279,8 +306,10 @@ public: } multi_array(const detail::multi_array:: - const_sub_array<T,NumDims>& rhs) - : super_type(0,c_storage_order(),rhs.index_bases(),rhs.shape()) + const_sub_array<T,NumDims>& rhs, + const Allocator& alloc = Allocator()) + : super_type(0,c_storage_order(),rhs.index_bases(),rhs.shape()), + alloc_base(boost::empty_init_t(),alloc) { allocate_space(); std::copy(rhs.begin(),rhs.end(),this->begin()); @@ -288,8 +317,10 @@ public: multi_array(const detail::multi_array:: const_sub_array<T,NumDims>& rhs, - const general_storage_order<NumDims>& so) - : super_type(0,so,rhs.index_bases(),rhs.shape()) + const general_storage_order<NumDims>& so, + const Allocator& alloc = Allocator()) + : super_type(0,so,rhs.index_bases(),rhs.shape()), + alloc_base(boost::empty_init_t(),alloc) { allocate_space(); std::copy(rhs.begin(),rhs.end(),this->begin()); @@ -297,8 +328,10 @@ public: multi_array(const detail::multi_array:: - const_multi_array_view<T,NumDims>& rhs) - : super_type(0,c_storage_order(),rhs.index_bases(),rhs.shape()) + const_multi_array_view<T,NumDims>& rhs, + const Allocator& alloc = Allocator()) + : super_type(0,c_storage_order(),rhs.index_bases(),rhs.shape()), + alloc_base(boost::empty_init_t(),alloc) { allocate_space(); std::copy(rhs.begin(),rhs.end(),this->begin()); @@ -306,8 +339,10 @@ public: multi_array(const detail::multi_array:: const_multi_array_view<T,NumDims>& rhs, - const general_storage_order<NumDims>& so) - : super_type(0,so,rhs.index_bases(),rhs.shape()) + const general_storage_order<NumDims>& so, + const Allocator& alloc = Allocator()) + : super_type(0,so,rhs.index_bases(),rhs.shape()), + alloc_base(boost::empty_init_t(),alloc) { allocate_space(); std::copy(rhs.begin(),rhs.end(),this->begin()); @@ -316,8 +351,10 @@ public: #endif // !BOOST_NO_FUNCTION_TEMPLATE_ORDERING // Thes constructors are necessary because of more exact template matches. - multi_array(const multi_array_ref<T,NumDims>& rhs) - : super_type(0,c_storage_order(),rhs.index_bases(),rhs.shape()) + multi_array(const multi_array_ref<T,NumDims>& rhs, + const Allocator& alloc = Allocator()) + : super_type(0,c_storage_order(),rhs.index_bases(),rhs.shape()), + alloc_base(boost::empty_init_t(),alloc) { allocate_space(); // Warning! storage order may change, hence the following copy technique. @@ -325,8 +362,10 @@ public: } multi_array(const multi_array_ref<T,NumDims>& rhs, - const general_storage_order<NumDims>& so) - : super_type(0,so,rhs.index_bases(),rhs.shape()) + const general_storage_order<NumDims>& so, + const Allocator& alloc = Allocator()) + : super_type(0,so,rhs.index_bases(),rhs.shape()), + alloc_base(boost::empty_init_t(),alloc) { allocate_space(); // Warning! storage order may change, hence the following copy technique. @@ -335,8 +374,10 @@ public: multi_array(const detail::multi_array:: - sub_array<T,NumDims>& rhs) - : super_type(0,c_storage_order(),rhs.index_bases(),rhs.shape()) + sub_array<T,NumDims>& rhs, + const Allocator& alloc = Allocator()) + : super_type(0,c_storage_order(),rhs.index_bases(),rhs.shape()), + alloc_base(boost::empty_init_t(),alloc) { allocate_space(); std::copy(rhs.begin(),rhs.end(),this->begin()); @@ -344,8 +385,10 @@ public: multi_array(const detail::multi_array:: sub_array<T,NumDims>& rhs, - const general_storage_order<NumDims>& so) - : super_type(0,so,rhs.index_bases(),rhs.shape()) + const general_storage_order<NumDims>& so, + const Allocator& alloc = Allocator()) + : super_type(0,so,rhs.index_bases(),rhs.shape()), + alloc_base(boost::empty_init_t(),alloc) { allocate_space(); std::copy(rhs.begin(),rhs.end(),this->begin()); @@ -353,8 +396,10 @@ public: multi_array(const detail::multi_array:: - multi_array_view<T,NumDims>& rhs) - : super_type(0,c_storage_order(),rhs.index_bases(),rhs.shape()) + multi_array_view<T,NumDims>& rhs, + const Allocator& alloc = Allocator()) + : super_type(0,c_storage_order(),rhs.index_bases(),rhs.shape()), + alloc_base(boost::empty_init_t(),alloc) { allocate_space(); std::copy(rhs.begin(),rhs.end(),this->begin()); @@ -362,8 +407,10 @@ public: multi_array(const detail::multi_array:: multi_array_view<T,NumDims>& rhs, - const general_storage_order<NumDims>& so) - : super_type(0,so,rhs.index_bases(),rhs.shape()) + const general_storage_order<NumDims>& so, + const Allocator& alloc = Allocator()) + : super_type(0,so,rhs.index_bases(),rhs.shape()), + alloc_base(boost::empty_init_t(),alloc) { allocate_space(); std::copy(rhs.begin(),rhs.end(),this->begin()); @@ -408,7 +455,7 @@ public: // build a multi_array with the specs given - multi_array new_array(ranges,this->storage_order()); + multi_array new_array(ranges,this->storage_order(),allocator()); // build a view of tmp with the minimum extents @@ -454,6 +501,7 @@ public: using std::swap; // Swap the internals of these arrays. swap(this->super_type::base_,new_array.super_type::base_); + swap(this->allocator(),new_array.allocator()); swap(this->storage_,new_array.storage_); swap(this->extent_list_,new_array.extent_list_); swap(this->stride_list_,new_array.stride_list_); @@ -461,7 +509,6 @@ public: swap(this->origin_offset_,new_array.origin_offset_); swap(this->directional_offset_,new_array.directional_offset_); swap(this->num_elements_,new_array.num_elements_); - swap(this->allocator_,new_array.allocator_); swap(this->base_,new_array.base_); swap(this->allocated_elements_,new_array.allocated_elements_); @@ -474,25 +521,43 @@ public: } private: + friend inline bool operator==(const multi_array& a, const multi_array& b) { + return a.base() == b.base(); + } + + friend inline bool operator!=(const multi_array& a, const multi_array& b) { + return !(a == b); + } + + const super_type& base() const { + return *this; + } + + const Allocator& allocator() const { + return alloc_base::get(); + } + + Allocator& allocator() { + return alloc_base::get(); + } + void allocate_space() { - base_ = allocator_.allocate(this->num_elements()); + base_ = allocator().allocate(this->num_elements()); this->set_base_ptr(base_); allocated_elements_ = this->num_elements(); - std::uninitialized_fill_n(base_,allocated_elements_,T()); + boost::alloc_construct_n(allocator(),base_,allocated_elements_); } void deallocate_space() { if(base_) { - for(T* i = base_; i != base_+allocated_elements_; ++i) - std::destroy_at(i); - allocator_.deallocate(base_,allocated_elements_); + boost::alloc_destroy_n(allocator(),base_,allocated_elements_); + allocator().deallocate(base_,allocated_elements_); } } typedef boost::array<size_type,NumDims> size_list; typedef boost::array<index,NumDims> index_list; - Allocator allocator_; T* base_; size_type allocated_elements_; enum {initial_base_ = 0}; @@ -504,4 +569,4 @@ private: # pragma GCC diagnostic pop #endif -#endif // BOOST_MULTI_ARRAY_RG071801_HPP +#endif diff --git a/contrib/restricted/boost/multi_array/include/boost/multi_array/algorithm.hpp b/contrib/restricted/boost/multi_array/include/boost/multi_array/algorithm.hpp index c749c3f974..01ac70fdb2 100644 --- a/contrib/restricted/boost/multi_array/include/boost/multi_array/algorithm.hpp +++ b/contrib/restricted/boost/multi_array/include/boost/multi_array/algorithm.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_ALGORITHM_RG071801_HPP -#define BOOST_ALGORITHM_RG071801_HPP +#ifndef BOOST_MULTI_ARRAY_ALGORITHM_HPP +#define BOOST_MULTI_ARRAY_ALGORITHM_HPP // // @@ -40,7 +40,7 @@ // See http://www.boost.org/libs/multi_array for documentation. -#include "boost/iterator.hpp" +#include <iterator> namespace boost { namespace detail { @@ -100,4 +100,4 @@ copy_n(InputIter first, Size count, OutputIter result) { } // namespace detail } // namespace boost -#endif // BOOST_ALGORITHM_RG071801_HPP +#endif diff --git a/contrib/restricted/boost/multi_array/include/boost/multi_array/base.hpp b/contrib/restricted/boost/multi_array/include/boost/multi_array/base.hpp index 62e5397284..4e621e1535 100644 --- a/contrib/restricted/boost/multi_array/include/boost/multi_array/base.hpp +++ b/contrib/restricted/boost/multi_array/include/boost/multi_array/base.hpp @@ -10,8 +10,8 @@ // Andrew Lumsdaine // See http://www.boost.org/libs/multi_array for documentation. -#ifndef BASE_RG071801_HPP -#define BASE_RG071801_HPP +#ifndef BOOST_MULTI_ARRAY_BASE_HPP +#define BOOST_MULTI_ARRAY_BASE_HPP // // base.hpp - some implementation base classes for from which @@ -498,4 +498,4 @@ protected: } // namespace boost -#endif // BASE_RG071801_HPP +#endif diff --git a/contrib/restricted/boost/multi_array/include/boost/multi_array/collection_concept.hpp b/contrib/restricted/boost/multi_array/include/boost/multi_array/collection_concept.hpp index c2cd403c4d..bad1d6f051 100644 --- a/contrib/restricted/boost/multi_array/include/boost/multi_array/collection_concept.hpp +++ b/contrib/restricted/boost/multi_array/include/boost/multi_array/collection_concept.hpp @@ -10,8 +10,8 @@ // Andrew Lumsdaine // See http://www.boost.org/libs/multi_array for documentation. -#ifndef COLLECTION_CONCEPT_RG103101_HPP -#define COLLECTION_CONCEPT_RG103101_HPP +#ifndef BOOST_MULTI_ARRAY_COLLECTION_CONCEPT_HPP +#define BOOST_MULTI_ARRAY_COLLECTION_CONCEPT_HPP #include "boost/concept_check.hpp" @@ -23,4 +23,4 @@ namespace multi_array { // Old location for this } } -#endif // COLLECTION_CONCEPT_RG103101_HPP +#endif diff --git a/contrib/restricted/boost/multi_array/include/boost/multi_array/concept_checks.hpp b/contrib/restricted/boost/multi_array/include/boost/multi_array/concept_checks.hpp index 9f70ae1ce7..4df71bcd13 100644 --- a/contrib/restricted/boost/multi_array/include/boost/multi_array/concept_checks.hpp +++ b/contrib/restricted/boost/multi_array/include/boost/multi_array/concept_checks.hpp @@ -10,8 +10,8 @@ // Andrew Lumsdaine // See http://www.boost.org/libs/multi_array for documentation. -#ifndef BOOST_MULTI_ARRAY_CONCEPT_CHECKS_RG110101_HPP -#define BOOST_MULTI_ARRAY_CONCEPT_CHECKS_RG110101_HPP +#ifndef BOOST_MULTI_ARRAY_CONCEPT_CHECKS_HPP +#define BOOST_MULTI_ARRAY_CONCEPT_CHECKS_HPP // // concept-checks.hpp - Checks out Const MultiArray and MultiArray @@ -218,4 +218,4 @@ namespace detail { } // namespace boost -#endif // BOOST_MULTI_ARRAY_CONCEPT_CHECKS_RG110101_HPP +#endif diff --git a/contrib/restricted/boost/multi_array/include/boost/multi_array/copy_array.hpp b/contrib/restricted/boost/multi_array/include/boost/multi_array/copy_array.hpp index f358b2be31..a448d58bba 100644 --- a/contrib/restricted/boost/multi_array/include/boost/multi_array/copy_array.hpp +++ b/contrib/restricted/boost/multi_array/include/boost/multi_array/copy_array.hpp @@ -10,8 +10,8 @@ // Andrew Lumsdaine // See http://www.boost.org/libs/multi_array for documentation. -#ifndef COPY_ARRAY_RG092101_HPP -#define COPY_ARRAY_RG092101_HPP +#ifndef BOOST_MULTI_ARRAY_COPY_ARRAY_HPP +#define BOOST_MULTI_ARRAY_COPY_ARRAY_HPP // // copy_array.hpp - generic code for copying the contents of one @@ -65,4 +65,4 @@ void copy_array (Array1& source, Array2& dest) { } // namespace detail } // namespace boost -#endif // COPY_ARRAY_RG092101_HPP +#endif diff --git a/contrib/restricted/boost/multi_array/include/boost/multi_array/extent_gen.hpp b/contrib/restricted/boost/multi_array/include/boost/multi_array/extent_gen.hpp index b009f66fd0..898b11705c 100644 --- a/contrib/restricted/boost/multi_array/include/boost/multi_array/extent_gen.hpp +++ b/contrib/restricted/boost/multi_array/include/boost/multi_array/extent_gen.hpp @@ -10,8 +10,8 @@ // Andrew Lumsdaine // See http://www.boost.org/libs/multi_array for documentation. -#ifndef BOOST_EXTENT_GEN_RG071801_HPP -#define BOOST_EXTENT_GEN_RG071801_HPP +#ifndef BOOST_MULTI_ARRAY_EXTENT_GEN_HPP +#define BOOST_MULTI_ARRAY_EXTENT_GEN_HPP #include "boost/multi_array/extent_range.hpp" #include "boost/multi_array/range_list.hpp" @@ -72,4 +72,4 @@ public: } // namespace boost -#endif // BOOST_EXTENT_GEN_RG071801_HPP +#endif diff --git a/contrib/restricted/boost/multi_array/include/boost/multi_array/extent_range.hpp b/contrib/restricted/boost/multi_array/include/boost/multi_array/extent_range.hpp index d7a2eafd0d..1ee77438ed 100644 --- a/contrib/restricted/boost/multi_array/include/boost/multi_array/extent_range.hpp +++ b/contrib/restricted/boost/multi_array/include/boost/multi_array/extent_range.hpp @@ -10,8 +10,8 @@ // Andrew Lumsdaine // See http://www.boost.org/libs/multi_array for documentation. -#ifndef BOOST_EXTENT_RANGE_RG071801_HPP -#define BOOST_EXTENT_RANGE_RG071801_HPP +#ifndef BOOST_MULTI_ARRAY_EXTENT_RANGE_HPP +#define BOOST_MULTI_ARRAY_EXTENT_RANGE_HPP #include <utility> @@ -46,4 +46,4 @@ public: } // namespace boost -#endif // BOOST_EXTENT_RANGE_RG071801_HPP +#endif diff --git a/contrib/restricted/boost/multi_array/include/boost/multi_array/index_gen.hpp b/contrib/restricted/boost/multi_array/include/boost/multi_array/index_gen.hpp index da8e1fdda7..a4fdaced7a 100644 --- a/contrib/restricted/boost/multi_array/include/boost/multi_array/index_gen.hpp +++ b/contrib/restricted/boost/multi_array/include/boost/multi_array/index_gen.hpp @@ -10,8 +10,8 @@ // Andrew Lumsdaine // See http://www.boost.org/libs/multi_array for documentation. -#ifndef BOOST_INDEX_GEN_RG071801_HPP -#define BOOST_INDEX_GEN_RG071801_HPP +#ifndef BOOST_MULTI_ARRAY_INDEX_GEN_HPP +#define BOOST_MULTI_ARRAY_INDEX_GEN_HPP #include "boost/array.hpp" #include "boost/multi_array/index_range.hpp" @@ -78,4 +78,4 @@ public: } // namespace boost -#endif // BOOST_INDEX_GEN_RG071801_HPP +#endif diff --git a/contrib/restricted/boost/multi_array/include/boost/multi_array/index_range.hpp b/contrib/restricted/boost/multi_array/include/boost/multi_array/index_range.hpp index 3d6035e744..fcb7c2e632 100644 --- a/contrib/restricted/boost/multi_array/include/boost/multi_array/index_range.hpp +++ b/contrib/restricted/boost/multi_array/include/boost/multi_array/index_range.hpp @@ -10,8 +10,8 @@ // Andrew Lumsdaine // See http://www.boost.org/libs/multi_array for documentation. -#ifndef BOOST_INDEX_RANGE_RG071801_HPP -#define BOOST_INDEX_RANGE_RG071801_HPP +#ifndef BOOST_MULTI_ARRAY_INDEX_RANGE_HPP +#define BOOST_MULTI_ARRAY_INDEX_RANGE_HPP #include <boost/config.hpp> #include <utility> @@ -107,6 +107,12 @@ namespace multi_array { index stride() const { return stride_; } + size_type size(index idx) const + { + return (start_ == from_start() || finish_ == to_end()) + ? idx : ((finish_ - start_) / stride_); + } + void set_index_range(index start, index finish, index stride=1) { start_ = start; @@ -185,4 +191,4 @@ namespace multi_array { } // namespace detail } // namespace boost -#endif // BOOST_INDEX_RANGE_RG071801_HPP +#endif diff --git a/contrib/restricted/boost/multi_array/include/boost/multi_array/iterator.hpp b/contrib/restricted/boost/multi_array/include/boost/multi_array/iterator.hpp index 5cde330544..ec5e61ce6c 100644 --- a/contrib/restricted/boost/multi_array/include/boost/multi_array/iterator.hpp +++ b/contrib/restricted/boost/multi_array/include/boost/multi_array/iterator.hpp @@ -10,8 +10,8 @@ // Andrew Lumsdaine // See http://www.boost.org/libs/multi_array for documentation. -#ifndef ITERATOR_RG071801_HPP -#define ITERATOR_RG071801_HPP +#ifndef BOOST_MULTI_ARRAY_ITERATOR_HPP +#define BOOST_MULTI_ARRAY_ITERATOR_HPP // // iterator.hpp - implementation of iterators for the @@ -162,4 +162,4 @@ public: } // namespace detail } // namespace boost -#endif // ITERATOR_RG071801_HPP +#endif diff --git a/contrib/restricted/boost/multi_array/include/boost/multi_array/multi_array_ref.hpp b/contrib/restricted/boost/multi_array/include/boost/multi_array/multi_array_ref.hpp index 7c0fb038a6..98c10c0f40 100644 --- a/contrib/restricted/boost/multi_array/include/boost/multi_array/multi_array_ref.hpp +++ b/contrib/restricted/boost/multi_array/include/boost/multi_array/multi_array_ref.hpp @@ -10,8 +10,8 @@ // Andrew Lumsdaine // See http://www.boost.org/libs/multi_array for documentation. -#ifndef BOOST_MULTI_ARRAY_REF_RG071801_HPP -#define BOOST_MULTI_ARRAY_REF_RG071801_HPP +#ifndef BOOST_MULTI_ARRAY_MULTI_ARRAY_REF_HPP +#define BOOST_MULTI_ARRAY_MULTI_ARRAY_REF_HPP // // multi_array_ref.hpp - code for creating "views" of array data. @@ -619,4 +619,4 @@ protected: } // namespace boost -#endif // BOOST_MULTI_ARRAY_REF_RG071801_HPP +#endif diff --git a/contrib/restricted/boost/multi_array/include/boost/multi_array/range_list.hpp b/contrib/restricted/boost/multi_array/include/boost/multi_array/range_list.hpp index 406571c5b0..46a65cb153 100644 --- a/contrib/restricted/boost/multi_array/include/boost/multi_array/range_list.hpp +++ b/contrib/restricted/boost/multi_array/include/boost/multi_array/range_list.hpp @@ -10,8 +10,8 @@ // Andrew Lumsdaine // See http://www.boost.org/libs/multi_array for documentation. -#ifndef RANGE_LIST_RG072501_HPP -#define RANGE_LIST_RG072501_HPP +#ifndef BOOST_MULTI_ARRAY_RANGE_LIST_HPP +#define BOOST_MULTI_ARRAY_RANGE_LIST_HPP // // range_list.hpp - helper to build boost::arrays for *_set types // @@ -67,4 +67,4 @@ public: } // namespace detail } // namespace boost -#endif // RANGE_LIST_RG072501_HPP +#endif diff --git a/contrib/restricted/boost/multi_array/include/boost/multi_array/storage_order.hpp b/contrib/restricted/boost/multi_array/include/boost/multi_array/storage_order.hpp index 3eb71360c1..5ede677e97 100644 --- a/contrib/restricted/boost/multi_array/include/boost/multi_array/storage_order.hpp +++ b/contrib/restricted/boost/multi_array/include/boost/multi_array/storage_order.hpp @@ -10,8 +10,8 @@ // Andrew Lumsdaine // See http://www.boost.org/libs/multi_array for documentation. -#ifndef BOOST_STORAGE_ORDER_RG071801_HPP -#define BOOST_STORAGE_ORDER_RG071801_HPP +#ifndef BOOST_MULTI_ARRAY_STORAGE_ORDER_HPP +#define BOOST_MULTI_ARRAY_STORAGE_ORDER_HPP #include "boost/multi_array/types.hpp" #include "boost/array.hpp" @@ -122,4 +122,4 @@ namespace boost { } // namespace boost -#endif // BOOST_ARRAY_STORAGE_RG071801_HPP +#endif diff --git a/contrib/restricted/boost/multi_array/include/boost/multi_array/subarray.hpp b/contrib/restricted/boost/multi_array/include/boost/multi_array/subarray.hpp index 5c36599c8d..2cb30d7076 100644 --- a/contrib/restricted/boost/multi_array/include/boost/multi_array/subarray.hpp +++ b/contrib/restricted/boost/multi_array/include/boost/multi_array/subarray.hpp @@ -10,8 +10,8 @@ // Andrew Lumsdaine // See http://www.boost.org/libs/multi_array for documentation. -#ifndef SUBARRAY_RG071801_HPP -#define SUBARRAY_RG071801_HPP +#ifndef BOOST_MULTI_ARRAY_SUBARRAY_HPP +#define BOOST_MULTI_ARRAY_SUBARRAY_HPP // // subarray.hpp - used to implement standard operator[] on @@ -384,4 +384,4 @@ public: }; } // namespace boost -#endif // SUBARRAY_RG071801_HPP +#endif diff --git a/contrib/restricted/boost/multi_array/include/boost/multi_array/types.hpp b/contrib/restricted/boost/multi_array/include/boost/multi_array/types.hpp index 5ef173b623..cdb9e4f9c5 100644 --- a/contrib/restricted/boost/multi_array/include/boost/multi_array/types.hpp +++ b/contrib/restricted/boost/multi_array/include/boost/multi_array/types.hpp @@ -11,8 +11,8 @@ // See http://www.boost.org/libs/multi_array for documentation. -#ifndef BOOST_MULTI_ARRAY_TYPES_RG071801_HPP -#define BOOST_MULTI_ARRAY_TYPES_RG071801_HPP +#ifndef BOOST_MULTI_ARRAY_TYPES_HPP +#define BOOST_MULTI_ARRAY_TYPES_HPP // // types.hpp - supply types that are needed by several headers @@ -35,4 +35,4 @@ typedef std::ptrdiff_t index; -#endif // BOOST_MULTI_ARRAY_TYPES_RG071801_HPP +#endif diff --git a/contrib/restricted/boost/multi_array/include/boost/multi_array/view.hpp b/contrib/restricted/boost/multi_array/include/boost/multi_array/view.hpp index 59ac089ddd..e637911857 100644 --- a/contrib/restricted/boost/multi_array/include/boost/multi_array/view.hpp +++ b/contrib/restricted/boost/multi_array/include/boost/multi_array/view.hpp @@ -10,8 +10,8 @@ // Andrew Lumsdaine // See http://www.boost.org/libs/multi_array for documentation. -#ifndef BOOST_MULTI_ARRAY_VIEW_RG071301_HPP -#define BOOST_MULTI_ARRAY_VIEW_RG071301_HPP +#ifndef BOOST_MULTI_ARRAY_VIEW_HPP +#define BOOST_MULTI_ARRAY_VIEW_HPP // // view.hpp - code for creating "views" of array data. @@ -457,5 +457,4 @@ public: } // namespace boost -#endif // BOOST_MULTI_ARRAY_VIEW_RG071301_HPP - +#endif |