/*============================================================================= Copyright (c) 2011-2016 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_SUB_ARRAY_SUB_HPP #define SPROUT_SUB_ARRAY_SUB_HPP #include #include #include #include #include #include #include namespace sprout { // // sub // template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type sub( Container& arr, typename sprout::container_traits >::const_iterator first, typename sprout::container_traits >::const_iterator last ) { return sprout::sub_array(arr, first, last); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type sub( Container& arr, typename sprout::container_traits >::const_iterator first ) { return sprout::sub(arr, first, sprout::end(arr)); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type sub( Container& arr, typename sprout::container_traits >::difference_type to_first, typename sprout::container_traits >::difference_type to_last ) { return sprout::sub_window(arr, to_first, to_last); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type sub( Container& arr, typename sprout::container_traits >::difference_type to_first = 0 ) { return sprout::sub_window(arr, to_first); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type sub( Container const& arr, typename sprout::container_traits >::const_iterator first, typename sprout::container_traits >::const_iterator last ) { return sprout::sub_array(arr, first, last); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type sub( Container const& arr, typename sprout::container_traits >::const_iterator first ) { return sprout::sub(arr, first, sprout::end(arr)); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type sub( Container const& arr, typename sprout::container_traits >::difference_type to_first, typename sprout::container_traits >::difference_type to_last ) { return sprout::sub_window(arr, to_first, to_last); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type sub( Container const& arr, typename sprout::container_traits >::difference_type to_first = 0 ) { return sprout::sub_window(arr, to_first); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, Container>::type sub( Container const& arr, typename sprout::container_traits::const_iterator first, typename sprout::container_traits::const_iterator last ) { return Container(arr, first, last); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, Container>::type sub( Container const& arr, typename sprout::container_traits::const_iterator first ) { return sprout::sub(arr, first, sprout::end(arr)); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, Container>::type sub( Container const& arr, typename sprout::container_traits::difference_type to_first, typename sprout::container_traits::difference_type to_last ) { return sprout::sub_window(arr, to_first, to_last); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, Container>::type sub( Container const& arr, typename sprout::container_traits::difference_type to_first = 0 ) { return sprout::sub_window(arr, to_first); } // // csub // template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type csub( Container const& arr, typename sprout::container_traits >::const_iterator first, typename sprout::container_traits >::const_iterator last ) { return sprout::sub_array(arr, first, last); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type csub( Container const& arr, typename sprout::container_traits >::const_iterator first ) { return sprout::csub(arr, first, sprout::end(arr)); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type csub( Container const& arr, typename sprout::container_traits >::difference_type to_first, typename sprout::container_traits >::difference_type to_last ) { return sprout::csub_window(arr, to_first, to_last); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type csub( Container const& arr, typename sprout::container_traits >::difference_type to_first = 0 ) { return sprout::csub_window(arr, to_first); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type csub( Container const& arr, typename sprout::container_traits::const_iterator first, typename sprout::container_traits::const_iterator last ) { return sprout::sub_array(arr.get_array(), first, last); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type csub( Container const& arr, typename sprout::container_traits::const_iterator first ) { return sprout::csub(arr, first, sprout::end(arr)); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type csub( Container const& arr, typename sprout::container_traits::difference_type to_first, typename sprout::container_traits::difference_type to_last ) { return sprout::csub_window(arr, to_first, to_last); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type csub( Container const& arr, typename sprout::container_traits::difference_type to_first = 0 ) { return sprout::csub_window(arr, to_first); } // // sub_copy // template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type sub_copy( Container const& arr, typename sprout::container_traits::const_iterator first, typename sprout::container_traits::const_iterator last ) { return sprout::sub_array(arr, first, last); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type sub_copy( Container const& arr, typename sprout::container_traits::const_iterator first ) { return sprout::sub_copy(arr, first, sprout::end(arr)); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type sub_copy( Container const& arr, typename sprout::container_traits::difference_type to_first, typename sprout::container_traits::difference_type to_last ) { return sprout::sub_window_copy(arr, to_first, to_last); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type sub_copy( Container const& arr, typename sprout::container_traits::difference_type to_first = 0 ) { return sprout::sub_window_copy(arr, to_first); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type sub_copy( Container const& arr, typename sprout::container_traits::const_iterator first, typename sprout::container_traits::const_iterator last ) { return sprout::sub_array(arr.get_array(), first, last); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type sub_copy( Container const& arr, typename sprout::container_traits::const_iterator first ) { return sprout::sub_copy(arr, first, sprout::end(arr)); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type sub_copy( Container const& arr, typename sprout::container_traits::difference_type to_first, typename sprout::container_traits::difference_type to_last ) { return sprout::sub_window_copy(arr, to_first, to_last); } template inline SPROUT_CONSTEXPR typename std::enable_if::value, sprout::sub_array >::type sub_copy( Container const& arr, typename sprout::container_traits::difference_type to_first = 0 ) { return sprout::sub_window_copy(arr, to_first); } } // namespace sprout #endif // #ifndef SPROUT_SUB_ARRAY_SUB_HPP