/*============================================================================= Copyright (c) 2011-2015 Bolero MURAKAMI https://github.com/bolero-MURAKAMI/Sprout Distributed under 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) =============================================================================*/ #ifndef SPROUT_RANGE_PTR_RANGE_HPP #define SPROUT_RANGE_PTR_RANGE_HPP #include #include #include #include #include #include namespace sprout { namespace range { // // make_ptr_range // template inline SPROUT_CONSTEXPR sprout::range::range_container > make_ptr_range(T* p, typename std::iterator_traits::difference_type n) { return sprout::range::range_container >( sprout::ptr_index_iterator(p), sprout::ptr_index_iterator(p, n) ); } template inline SPROUT_CONSTEXPR sprout::range::range_container > make_ptr_range(T* first, T* last) { return sprout::range::range_container >( sprout::ptr_index_iterator(first), sprout::ptr_index_iterator(first, sprout::distance(first, last)) ); } template inline SPROUT_CONSTEXPR sprout::range::range_container > make_ptr_range(T (& arr)[N]) { return sprout::range::range_container >( sprout::ptr_index_iterator(arr), sprout::ptr_index_iterator(arr, N) ); } } // namespace range } // namespace sprout #endif // #ifndef SPROUT_RANGE_PTR_RANGE_HPP