/*============================================================================= Copyright (c) 2011-2017 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_CONTAINER_RANGE_INDEX_CHECK_HPP #define SPROUT_CONTAINER_RANGE_INDEX_CHECK_HPP #include #include #include #include namespace sprout { // // range_index_check // template inline SPROUT_CONSTEXPR typename sprout::container_traits::size_type range_index_check(Container const& cont, typename sprout::container_traits::size_type i) { return i < sprout::size(cont) ? i : throw std::out_of_range("range_index_check: index out of range") ; } } // namespace sprout #include #endif // #ifndef SPROUT_CONTAINER_RANGE_INDEX_CHECK_HPP