mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-05-12 09:33:30 +00:00
add sub_window, add sub_offset
This commit is contained in:
parent
bf8c46b203
commit
899bf3fa77
72 changed files with 610 additions and 353 deletions
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
|
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/functional/equal_to.hpp>
|
#include <sprout/functional/equal_to.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
#include <sprout/detail/algorithm/search_one.hpp>
|
#include <sprout/detail/algorithm/search_one.hpp>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/functional/equal_to.hpp>
|
#include <sprout/functional/equal_to.hpp>
|
||||||
#include <sprout/functional/bind2nd.hpp>
|
#include <sprout/functional/bind2nd.hpp>
|
||||||
#include <sprout/algorithm/find_if.hpp>
|
#include <sprout/algorithm/find_if.hpp>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <sprout/algorithm/fit/result_of.hpp>
|
#include <sprout/algorithm/fit/result_of.hpp>
|
||||||
#include <sprout/sub_array/sub_array.hpp>
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fit {
|
namespace fit {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <sprout/algorithm/fit/result_of.hpp>
|
#include <sprout/algorithm/fit/result_of.hpp>
|
||||||
#include <sprout/sub_array/sub_array.hpp>
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fit {
|
namespace fit {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <sprout/algorithm/fit/result_of.hpp>
|
#include <sprout/algorithm/fit/result_of.hpp>
|
||||||
#include <sprout/sub_array/sub_array.hpp>
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fit {
|
namespace fit {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <sprout/algorithm/fit/result_of.hpp>
|
#include <sprout/algorithm/fit/result_of.hpp>
|
||||||
#include <sprout/sub_array/sub_array.hpp>
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fit {
|
namespace fit {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <sprout/algorithm/fit/result_of.hpp>
|
#include <sprout/algorithm/fit/result_of.hpp>
|
||||||
#include <sprout/sub_array/sub_array.hpp>
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fit {
|
namespace fit {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <sprout/algorithm/fit/result_of.hpp>
|
#include <sprout/algorithm/fit/result_of.hpp>
|
||||||
#include <sprout/sub_array/sub_array.hpp>
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fit {
|
namespace fit {
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
#include <sprout/detail/algorithm/count_n_if.hpp>
|
#include <sprout/detail/algorithm/count_n_if.hpp>
|
||||||
#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT
|
#include HDR_ALGORITHM_MIN_MAX_SSCRISK_CEL_OR_SPROUT
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fit {
|
namespace fit {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <sprout/algorithm/fit/result_of.hpp>
|
#include <sprout/algorithm/fit/result_of.hpp>
|
||||||
#include <sprout/sub_array/sub_array.hpp>
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fit {
|
namespace fit {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <sprout/algorithm/fit/result_of.hpp>
|
#include <sprout/algorithm/fit/result_of.hpp>
|
||||||
#include <sprout/sub_array/sub_array.hpp>
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fit {
|
namespace fit {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <sprout/algorithm/fit/result_of.hpp>
|
#include <sprout/algorithm/fit/result_of.hpp>
|
||||||
#include <sprout/sub_array/sub_array.hpp>
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fit {
|
namespace fit {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <sprout/algorithm/fit/result_of.hpp>
|
#include <sprout/algorithm/fit/result_of.hpp>
|
||||||
#include <sprout/sub_array/sub_array.hpp>
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fit {
|
namespace fit {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <sprout/sub_array/sub_array.hpp>
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
#include <sprout/detail/algorithm/set_overlap_count.hpp>
|
#include <sprout/detail/algorithm/set_overlap_count.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fit {
|
namespace fit {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <sprout/sub_array/sub_array.hpp>
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
#include <sprout/detail/algorithm/set_overlap_count.hpp>
|
#include <sprout/detail/algorithm/set_overlap_count.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fit {
|
namespace fit {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <sprout/sub_array/sub_array.hpp>
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
#include <sprout/detail/algorithm/set_overlap_count.hpp>
|
#include <sprout/detail/algorithm/set_overlap_count.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fit {
|
namespace fit {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <sprout/sub_array/sub_array.hpp>
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
#include <sprout/detail/algorithm/set_overlap_count.hpp>
|
#include <sprout/detail/algorithm/set_overlap_count.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fit {
|
namespace fit {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <sprout/algorithm/fit/result_of.hpp>
|
#include <sprout/algorithm/fit/result_of.hpp>
|
||||||
#include <sprout/sub_array/sub_array.hpp>
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fit {
|
namespace fit {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <sprout/algorithm/fit/result_of.hpp>
|
#include <sprout/algorithm/fit/result_of.hpp>
|
||||||
#include <sprout/sub_array/sub_array.hpp>
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fit {
|
namespace fit {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <sprout/sub_array/sub_array.hpp>
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
#include <sprout/detail/algorithm/overlap_count.hpp>
|
#include <sprout/detail/algorithm/overlap_count.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fit {
|
namespace fit {
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include <sprout/pit/pit.hpp>
|
#include <sprout/pit/pit.hpp>
|
||||||
#include <sprout/math/comparison.hpp>
|
#include <sprout/math/comparison.hpp>
|
||||||
#include <sprout/detail/container_complate.hpp>
|
#include <sprout/detail/container_complate.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fixed {
|
namespace fixed {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <sprout/algorithm/fixed/result_of.hpp>
|
#include <sprout/algorithm/fixed/result_of.hpp>
|
||||||
#include <sprout/pit/pit.hpp>
|
#include <sprout/pit/pit.hpp>
|
||||||
#include <sprout/detail/container_complate.hpp>
|
#include <sprout/detail/container_complate.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fixed {
|
namespace fixed {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/functional/less.hpp>
|
#include <sprout/functional/less.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
#include <sprout/algorithm/none_of.hpp>
|
#include <sprout/algorithm/none_of.hpp>
|
||||||
#include <sprout/algorithm/find_if_not.hpp>
|
#include <sprout/algorithm/find_if_not.hpp>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/algorithm/is_sorted_until.hpp>
|
#include <sprout/algorithm/is_sorted_until.hpp>
|
||||||
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
|
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
|
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/iterator/type_traits/common.hpp>
|
#include <sprout/iterator/type_traits/common.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
#include <sprout/algorithm/min.hpp>
|
#include <sprout/algorithm/min.hpp>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
|
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
|
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
#include <sprout/utility/pair/access.hpp>
|
#include <sprout/utility/pair/access.hpp>
|
||||||
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
|
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/functional/equal_to.hpp>
|
#include <sprout/functional/equal_to.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
#include <sprout/detail/algorithm/search_one.hpp>
|
#include <sprout/detail/algorithm/search_one.hpp>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include <sprout/container/functions.hpp>
|
#include <sprout/container/functions.hpp>
|
||||||
#include <sprout/index_tuple.hpp>
|
#include <sprout/index_tuple.hpp>
|
||||||
#include <sprout/pit/pit.hpp>
|
#include <sprout/pit/pit.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/range/adaptor/size_enumed.hpp>
|
#include <sprout/range/adaptor/size_enumed.hpp>
|
||||||
#include <sprout/range/algorithm/lower_bound.hpp>
|
#include <sprout/range/algorithm/lower_bound.hpp>
|
||||||
#include <sprout/range/numeric/partial_sum.hpp>
|
#include <sprout/range/numeric/partial_sum.hpp>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/iterator/type_traits/common.hpp>
|
#include <sprout/iterator/type_traits/common.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
#include <sprout/algorithm/min.hpp>
|
#include <sprout/algorithm/min.hpp>
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include <sprout/container/internal_begin_offset_backward.hpp>
|
#include <sprout/container/internal_begin_offset_backward.hpp>
|
||||||
#include <sprout/container/internal_end_offset_backward.hpp>
|
#include <sprout/container/internal_end_offset_backward.hpp>
|
||||||
#include <sprout/iterator/remake_iterator.hpp>
|
#include <sprout/iterator/remake_iterator.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/forward.hpp>
|
#include <sprout/utility/forward.hpp>
|
||||||
#include <sprout/tpp/algorithm/all_of.hpp>
|
#include <sprout/tpp/algorithm/all_of.hpp>
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
#include <sprout/algorithm/count.hpp>
|
#include <sprout/algorithm/count.hpp>
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
#include <sprout/algorithm/count_if.hpp>
|
#include <sprout/algorithm/count_if.hpp>
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/tuple/tuple/tuple.hpp>
|
#include <sprout/tuple/tuple/tuple.hpp>
|
||||||
#include <sprout/tuple/tuple/get.hpp>
|
#include <sprout/tuple/tuple/get.hpp>
|
||||||
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
|
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/iterator/type_traits/common.hpp>
|
#include <sprout/iterator/type_traits/common.hpp>
|
||||||
#include <sprout/tuple/tuple/tuple.hpp>
|
#include <sprout/tuple/tuple/tuple.hpp>
|
||||||
#include <sprout/tuple/tuple/get.hpp>
|
#include <sprout/tuple/tuple/get.hpp>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/next.hpp>
|
#include <sprout/iterator/next.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
#include <sprout/adl/not_found.hpp>
|
#include <sprout/adl/not_found.hpp>
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#define SPROUT_ITERATOR_TYPE_TRAITS_HPP
|
#define SPROUT_ITERATOR_TYPE_TRAITS_HPP
|
||||||
|
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/iterator/type_traits/common.hpp>
|
#include <sprout/iterator/type_traits/common.hpp>
|
||||||
|
|
||||||
#endif // #ifndef SPROUT_ITERATOR_TYPE_TRAITS_HPP
|
#endif // #ifndef SPROUT_ITERATOR_TYPE_TRAITS_HPP
|
||||||
|
|
10
sprout/iterator/type_traits/category.hpp
Normal file
10
sprout/iterator/type_traits/category.hpp
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#ifndef SPROUT_ITERATOR_TYPE_TRAITS_CATEGORY_HPP
|
||||||
|
#define SPROUT_ITERATOR_TYPE_TRAITS_CATEGORY_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_category_of.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_constant_distance_iterator.hpp>
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_ITERATOR_TYPE_TRAITS_CATEGORY_HPP
|
|
@ -4,7 +4,7 @@
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
#ifndef SPROUT_ITERATOR_TYPE_TRAITS_IS_CONSTANT_DISTANCE_ITERATOR_HPP
|
||||||
|
#define SPROUT_ITERATOR_TYPE_TRAITS_IS_CONSTANT_DISTANCE_ITERATOR_HPP
|
||||||
|
|
||||||
|
#include <type_traits>
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
|
||||||
|
//
|
||||||
|
// is_constant_distance_iterator
|
||||||
|
//
|
||||||
|
template<typename MaybeIterator>
|
||||||
|
struct is_constant_distance_iterator
|
||||||
|
: public std::integral_constant<
|
||||||
|
bool,
|
||||||
|
sprout::is_random_access_iterator<MaybeIterator>::value && !std::is_pointer<MaybeIterator>::value
|
||||||
|
>
|
||||||
|
{};
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_ITERATOR_TYPE_TRAITS_IS_CONSTANT_DISTANCE_ITERATOR_HPP
|
|
@ -2,7 +2,6 @@
|
||||||
#define SPROUT_ITERATOR_TYPE_TRAITS_IS_ITERATOR_HPP
|
#define SPROUT_ITERATOR_TYPE_TRAITS_IS_ITERATOR_HPP
|
||||||
|
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <type_traits>
|
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/type_traits/has_xxx.hpp>
|
#include <sprout/type_traits/has_xxx.hpp>
|
||||||
|
|
||||||
|
@ -13,6 +12,7 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
SPROUT_HAS_XXX_TYPE_DEF_LAZY(iterator_category);
|
SPROUT_HAS_XXX_TYPE_DEF_LAZY(iterator_category);
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
//
|
//
|
||||||
// is_iterator
|
// is_iterator
|
||||||
//
|
//
|
||||||
|
@ -20,119 +20,6 @@ namespace sprout {
|
||||||
struct is_iterator
|
struct is_iterator
|
||||||
: public sprout::detail::has_iterator_category<std::iterator_traits<MaybeIterator> >
|
: public sprout::detail::has_iterator_category<std::iterator_traits<MaybeIterator> >
|
||||||
{};
|
{};
|
||||||
|
|
||||||
//
|
|
||||||
// is_iterator_category_of
|
|
||||||
//
|
|
||||||
template<typename MaybeCategory, typename Category>
|
|
||||||
struct is_iterator_category_of
|
|
||||||
: public std::is_convertible<MaybeCategory, Category>
|
|
||||||
{};
|
|
||||||
|
|
||||||
//
|
|
||||||
// is_input_iterator_category
|
|
||||||
//
|
|
||||||
template<typename MaybeCategory>
|
|
||||||
struct is_input_iterator_category
|
|
||||||
: public sprout::is_iterator_category_of<MaybeCategory, std::input_iterator_tag>
|
|
||||||
{};
|
|
||||||
//
|
|
||||||
// is_output_iterator_category
|
|
||||||
//
|
|
||||||
template<typename MaybeCategory>
|
|
||||||
struct is_output_iterator_category
|
|
||||||
: public sprout::is_iterator_category_of<MaybeCategory, std::output_iterator_tag>
|
|
||||||
{};
|
|
||||||
//
|
|
||||||
// is_forward_iterator_category
|
|
||||||
//
|
|
||||||
template<typename MaybeCategory>
|
|
||||||
struct is_forward_iterator_category
|
|
||||||
: public sprout::is_iterator_category_of<MaybeCategory, std::forward_iterator_tag>
|
|
||||||
{};
|
|
||||||
//
|
|
||||||
// is_bidirectional_iterator_category
|
|
||||||
//
|
|
||||||
template<typename MaybeCategory>
|
|
||||||
struct is_bidirectional_iterator_category
|
|
||||||
: public sprout::is_iterator_category_of<MaybeCategory, std::bidirectional_iterator_tag>
|
|
||||||
{};
|
|
||||||
//
|
|
||||||
// is_random_access_iterator_category
|
|
||||||
//
|
|
||||||
template<typename MaybeCategory>
|
|
||||||
struct is_random_access_iterator_category
|
|
||||||
: public sprout::is_iterator_category_of<MaybeCategory, std::random_access_iterator_tag>
|
|
||||||
{};
|
|
||||||
|
|
||||||
namespace detail {
|
|
||||||
template<typename MaybeIterator, typename Category, typename = void>
|
|
||||||
struct is_iterator_of_impl
|
|
||||||
: public std::false_type
|
|
||||||
{};
|
|
||||||
template<typename MaybeIterator, typename Category>
|
|
||||||
struct is_iterator_of_impl<
|
|
||||||
MaybeIterator, Category,
|
|
||||||
typename std::enable_if<sprout::is_iterator<MaybeIterator>::value>::type
|
|
||||||
>
|
|
||||||
: public sprout::is_iterator_category_of<typename std::iterator_traits<MaybeIterator>::iterator_category, Category>
|
|
||||||
{};
|
|
||||||
} // namespace detail
|
|
||||||
|
|
||||||
//
|
|
||||||
// is_iterator_of
|
|
||||||
//
|
|
||||||
template<typename MaybeIterator, typename Category>
|
|
||||||
struct is_iterator_of
|
|
||||||
: public sprout::detail::is_iterator_of_impl<MaybeIterator, Category>
|
|
||||||
{};
|
|
||||||
|
|
||||||
//
|
|
||||||
// is_input_iterator
|
|
||||||
//
|
|
||||||
template<typename MaybeIterator>
|
|
||||||
struct is_input_iterator
|
|
||||||
: public sprout::is_iterator_of<MaybeIterator, std::input_iterator_tag>
|
|
||||||
{};
|
|
||||||
//
|
|
||||||
// is_output_iterator
|
|
||||||
//
|
|
||||||
template<typename MaybeIterator>
|
|
||||||
struct is_output_iterator
|
|
||||||
: public sprout::is_iterator_of<MaybeIterator, std::output_iterator_tag>
|
|
||||||
{};
|
|
||||||
//
|
|
||||||
// is_forward_iterator
|
|
||||||
//
|
|
||||||
template<typename MaybeIterator>
|
|
||||||
struct is_forward_iterator
|
|
||||||
: public sprout::is_iterator_of<MaybeIterator, std::forward_iterator_tag>
|
|
||||||
{};
|
|
||||||
//
|
|
||||||
// is_bidirectional_iterator
|
|
||||||
//
|
|
||||||
template<typename MaybeIterator>
|
|
||||||
struct is_bidirectional_iterator
|
|
||||||
: public sprout::is_iterator_of<MaybeIterator, std::bidirectional_iterator_tag>
|
|
||||||
{};
|
|
||||||
//
|
|
||||||
// is_random_access_iterator
|
|
||||||
//
|
|
||||||
template<typename MaybeIterator>
|
|
||||||
struct is_random_access_iterator
|
|
||||||
: public sprout::is_iterator_of<MaybeIterator, std::random_access_iterator_tag>
|
|
||||||
{};
|
|
||||||
|
|
||||||
//
|
|
||||||
// is_constant_distance_iterator
|
|
||||||
//
|
|
||||||
template<typename MaybeIterator>
|
|
||||||
struct is_constant_distance_iterator
|
|
||||||
: public std::integral_constant<
|
|
||||||
bool,
|
|
||||||
sprout::is_random_access_iterator<MaybeIterator>::value && !std::is_pointer<MaybeIterator>::value
|
|
||||||
>
|
|
||||||
{};
|
|
||||||
} // namespace sprout
|
} // namespace sprout
|
||||||
|
|
||||||
#endif // #ifndef SPROUT_ITERATOR_TYPE_TRAITS_IS_ITERATOR_HPP
|
#endif // #ifndef SPROUT_ITERATOR_TYPE_TRAITS_IS_ITERATOR_HPP
|
||||||
|
|
54
sprout/iterator/type_traits/is_iterator_category_of.hpp
Normal file
54
sprout/iterator/type_traits/is_iterator_category_of.hpp
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
#ifndef SPROUT_ITERATOR_TYPE_TRAITS_IS_ITERATOR_CATEGORY_OF_HPP
|
||||||
|
#define SPROUT_ITERATOR_TYPE_TRAITS_IS_ITERATOR_CATEGORY_OF_HPP
|
||||||
|
|
||||||
|
#include <iterator>
|
||||||
|
#include <type_traits>
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
//
|
||||||
|
// is_iterator_category_of
|
||||||
|
//
|
||||||
|
template<typename MaybeCategory, typename Category>
|
||||||
|
struct is_iterator_category_of
|
||||||
|
: public std::is_convertible<MaybeCategory, Category>
|
||||||
|
{};
|
||||||
|
|
||||||
|
//
|
||||||
|
// is_input_iterator_category
|
||||||
|
//
|
||||||
|
template<typename MaybeCategory>
|
||||||
|
struct is_input_iterator_category
|
||||||
|
: public sprout::is_iterator_category_of<MaybeCategory, std::input_iterator_tag>
|
||||||
|
{};
|
||||||
|
//
|
||||||
|
// is_output_iterator_category
|
||||||
|
//
|
||||||
|
template<typename MaybeCategory>
|
||||||
|
struct is_output_iterator_category
|
||||||
|
: public sprout::is_iterator_category_of<MaybeCategory, std::output_iterator_tag>
|
||||||
|
{};
|
||||||
|
//
|
||||||
|
// is_forward_iterator_category
|
||||||
|
//
|
||||||
|
template<typename MaybeCategory>
|
||||||
|
struct is_forward_iterator_category
|
||||||
|
: public sprout::is_iterator_category_of<MaybeCategory, std::forward_iterator_tag>
|
||||||
|
{};
|
||||||
|
//
|
||||||
|
// is_bidirectional_iterator_category
|
||||||
|
//
|
||||||
|
template<typename MaybeCategory>
|
||||||
|
struct is_bidirectional_iterator_category
|
||||||
|
: public sprout::is_iterator_category_of<MaybeCategory, std::bidirectional_iterator_tag>
|
||||||
|
{};
|
||||||
|
//
|
||||||
|
// is_random_access_iterator_category
|
||||||
|
//
|
||||||
|
template<typename MaybeCategory>
|
||||||
|
struct is_random_access_iterator_category
|
||||||
|
: public sprout::is_iterator_category_of<MaybeCategory, std::random_access_iterator_tag>
|
||||||
|
{};
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_ITERATOR_TYPE_TRAITS_IS_ITERATOR_CATEGORY_OF_HPP
|
70
sprout/iterator/type_traits/is_iterator_of.hpp
Normal file
70
sprout/iterator/type_traits/is_iterator_of.hpp
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
#ifndef SPROUT_ITERATOR_TYPE_TRAITS_IS_ITERATOR_OF_HPP
|
||||||
|
#define SPROUT_ITERATOR_TYPE_TRAITS_IS_ITERATOR_OF_HPP
|
||||||
|
|
||||||
|
#include <iterator>
|
||||||
|
#include <type_traits>
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_category_of.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace detail {
|
||||||
|
template<typename MaybeIterator, typename Category, typename = void>
|
||||||
|
struct is_iterator_of_impl
|
||||||
|
: public std::false_type
|
||||||
|
{};
|
||||||
|
template<typename MaybeIterator, typename Category>
|
||||||
|
struct is_iterator_of_impl<
|
||||||
|
MaybeIterator, Category,
|
||||||
|
typename std::enable_if<sprout::is_iterator<MaybeIterator>::value>::type
|
||||||
|
>
|
||||||
|
: public sprout::is_iterator_category_of<typename std::iterator_traits<MaybeIterator>::iterator_category, Category>
|
||||||
|
{};
|
||||||
|
} // namespace detail
|
||||||
|
|
||||||
|
//
|
||||||
|
// is_iterator_of
|
||||||
|
//
|
||||||
|
template<typename MaybeIterator, typename Category>
|
||||||
|
struct is_iterator_of
|
||||||
|
: public sprout::detail::is_iterator_of_impl<MaybeIterator, Category>
|
||||||
|
{};
|
||||||
|
|
||||||
|
//
|
||||||
|
// is_input_iterator
|
||||||
|
//
|
||||||
|
template<typename MaybeIterator>
|
||||||
|
struct is_input_iterator
|
||||||
|
: public sprout::is_iterator_of<MaybeIterator, std::input_iterator_tag>
|
||||||
|
{};
|
||||||
|
//
|
||||||
|
// is_output_iterator
|
||||||
|
//
|
||||||
|
template<typename MaybeIterator>
|
||||||
|
struct is_output_iterator
|
||||||
|
: public sprout::is_iterator_of<MaybeIterator, std::output_iterator_tag>
|
||||||
|
{};
|
||||||
|
//
|
||||||
|
// is_forward_iterator
|
||||||
|
//
|
||||||
|
template<typename MaybeIterator>
|
||||||
|
struct is_forward_iterator
|
||||||
|
: public sprout::is_iterator_of<MaybeIterator, std::forward_iterator_tag>
|
||||||
|
{};
|
||||||
|
//
|
||||||
|
// is_bidirectional_iterator
|
||||||
|
//
|
||||||
|
template<typename MaybeIterator>
|
||||||
|
struct is_bidirectional_iterator
|
||||||
|
: public sprout::is_iterator_of<MaybeIterator, std::bidirectional_iterator_tag>
|
||||||
|
{};
|
||||||
|
//
|
||||||
|
// is_random_access_iterator
|
||||||
|
//
|
||||||
|
template<typename MaybeIterator>
|
||||||
|
struct is_random_access_iterator
|
||||||
|
: public sprout::is_iterator_of<MaybeIterator, std::random_access_iterator_tag>
|
||||||
|
{};
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_ITERATOR_TYPE_TRAITS_IS_ITERATOR_OF_HPP
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/functional/plus.hpp>
|
#include <sprout/functional/plus.hpp>
|
||||||
#include <sprout/utility/pair/pair.hpp>
|
#include <sprout/utility/pair/pair.hpp>
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <sprout/sub_array/sub_array.hpp>
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
#include <sprout/pit/pit.hpp>
|
#include <sprout/pit/pit.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fit {
|
namespace fit {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <sprout/sub_array/sub_array.hpp>
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
#include <sprout/pit/pit.hpp>
|
#include <sprout/pit/pit.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fit {
|
namespace fit {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <sprout/algorithm/fit/result_of.hpp>
|
#include <sprout/algorithm/fit/result_of.hpp>
|
||||||
#include <sprout/sub_array/sub_array.hpp>
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fit {
|
namespace fit {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <sprout/algorithm/fit/result_of.hpp>
|
#include <sprout/algorithm/fit/result_of.hpp>
|
||||||
#include <sprout/sub_array/sub_array.hpp>
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
namespace fit {
|
namespace fit {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/iterator/type_traits/is_iterator.hpp>
|
#include <sprout/iterator/type_traits/category.hpp>
|
||||||
#include <sprout/iterator/type_traits/common.hpp>
|
#include <sprout/iterator/type_traits/common.hpp>
|
||||||
#include <sprout/functional/plus.hpp>
|
#include <sprout/functional/plus.hpp>
|
||||||
#include <sprout/functional/multiplies.hpp>
|
#include <sprout/functional/multiplies.hpp>
|
||||||
|
|
|
@ -88,18 +88,18 @@ namespace sprout {
|
||||||
return sprout::adaptors::detail::adapted_range_default<
|
return sprout::adaptors::detail::adapted_range_default<
|
||||||
typename std::remove_reference<typename sprout::lvalue_reference<Range>::type>::type
|
typename std::remove_reference<typename sprout::lvalue_reference<Range>::type>::type
|
||||||
>(
|
>(
|
||||||
sprout::next(
|
sprout::next(
|
||||||
sprout::begin(sprout::lvalue_forward<Range>(lhs)),
|
sprout::begin(sprout::lvalue_forward<Range>(lhs)),
|
||||||
NS_SSCRISK_CEL_OR_SPROUT::min<difference_type>(rhs.from_begin(), sprout::size(sprout::lvalue_forward<Range>(lhs)))
|
NS_SSCRISK_CEL_OR_SPROUT::min<difference_type>(rhs.from_begin(), sprout::size(sprout::lvalue_forward<Range>(lhs)))
|
||||||
),
|
),
|
||||||
sprout::next(
|
sprout::next(
|
||||||
sprout::end(sprout::lvalue_forward<Range>(lhs)),
|
sprout::end(sprout::lvalue_forward<Range>(lhs)),
|
||||||
NS_SSCRISK_CEL_OR_SPROUT::max<difference_type>(
|
NS_SSCRISK_CEL_OR_SPROUT::max<difference_type>(
|
||||||
rhs.from_end(),
|
rhs.from_end(),
|
||||||
NS_SSCRISK_CEL_OR_SPROUT::min<difference_type>(rhs.from_begin() - sprout::size(sprout::lvalue_forward<Range>(lhs)), 0)
|
NS_SSCRISK_CEL_OR_SPROUT::min<difference_type>(rhs.from_begin() - sprout::size(sprout::lvalue_forward<Range>(lhs)), 0)
|
||||||
)
|
|
||||||
)
|
)
|
||||||
);
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
template<typename Range, typename Difference>
|
template<typename Range, typename Difference>
|
||||||
inline SPROUT_CONSTEXPR sprout::adaptors::detail::adapted_range_default<
|
inline SPROUT_CONSTEXPR sprout::adaptors::detail::adapted_range_default<
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
#include <sprout/sub_array/tuple.hpp>
|
#include <sprout/sub_array/tuple.hpp>
|
||||||
#include <sprout/sub_array/container.hpp>
|
#include <sprout/sub_array/container.hpp>
|
||||||
#include <sprout/sub_array/sub.hpp>
|
#include <sprout/sub_array/sub.hpp>
|
||||||
|
#include <sprout/sub_array/sub_window.hpp>
|
||||||
|
#include <sprout/sub_array/sub_offset.hpp>
|
||||||
#include <sprout/sub_array/type_traits.hpp>
|
#include <sprout/sub_array/type_traits.hpp>
|
||||||
|
|
||||||
#endif // #ifndef SPROUT_SUB_ARRAY_HPP
|
#endif // #ifndef SPROUT_SUB_ARRAY_HPP
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include <sprout/container/functions.hpp>
|
#include <sprout/container/functions.hpp>
|
||||||
#include <sprout/sub_array/sub_array.hpp>
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
#include <sprout/sub_array/type_traits.hpp>
|
#include <sprout/sub_array/type_traits.hpp>
|
||||||
|
#include <sprout/sub_array/sub_window.hpp>
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
//
|
//
|
||||||
|
@ -24,16 +25,6 @@ namespace sprout {
|
||||||
}
|
}
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container&> >::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container&> >::type
|
||||||
sub(
|
|
||||||
Container& arr,
|
|
||||||
typename sprout::container_traits<sprout::sub_array<Container&> >::difference_type first,
|
|
||||||
typename sprout::container_traits<sprout::sub_array<Container&> >::difference_type last
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return sprout::sub_array<Container&>(arr, first, last);
|
|
||||||
}
|
|
||||||
template<typename Container>
|
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container&> >::type
|
|
||||||
sub(
|
sub(
|
||||||
Container& arr,
|
Container& arr,
|
||||||
typename sprout::container_traits<sprout::sub_array<Container&> >::const_iterator first
|
typename sprout::container_traits<sprout::sub_array<Container&> >::const_iterator first
|
||||||
|
@ -45,22 +36,22 @@ namespace sprout {
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container&> >::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container&> >::type
|
||||||
sub(
|
sub(
|
||||||
Container& arr,
|
Container& arr,
|
||||||
typename sprout::container_traits<sprout::sub_array<Container&> >::difference_type first
|
typename sprout::container_traits<sprout::sub_array<Container&> >::difference_type to_first,
|
||||||
|
typename sprout::container_traits<sprout::sub_array<Container&> >::difference_type to_last
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return sprout::sub(arr, first, sprout::size(arr));
|
return sprout::sub_window(arr, to_first, to_last);
|
||||||
}
|
}
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container&> >::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container&> >::type
|
||||||
sub(
|
sub(
|
||||||
Container& arr
|
Container& arr,
|
||||||
|
typename sprout::container_traits<sprout::sub_array<Container&> >::difference_type to_first = 0
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return sprout::sub(arr, sprout::begin(arr), sprout::end(arr));
|
return sprout::sub_window(arr, to_first);
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// sub
|
|
||||||
//
|
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container const&> >::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container const&> >::type
|
||||||
sub(
|
sub(
|
||||||
|
@ -73,16 +64,6 @@ namespace sprout {
|
||||||
}
|
}
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container const&> >::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container const&> >::type
|
||||||
sub(
|
|
||||||
Container const& arr,
|
|
||||||
typename sprout::container_traits<sprout::sub_array<Container const&> >::difference_type first,
|
|
||||||
typename sprout::container_traits<sprout::sub_array<Container const&> >::difference_type last
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return sprout::sub_array<Container const&>(arr, first, last);
|
|
||||||
}
|
|
||||||
template<typename Container>
|
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container const&> >::type
|
|
||||||
sub(
|
sub(
|
||||||
Container const& arr,
|
Container const& arr,
|
||||||
typename sprout::container_traits<sprout::sub_array<Container const&> >::const_iterator first
|
typename sprout::container_traits<sprout::sub_array<Container const&> >::const_iterator first
|
||||||
|
@ -94,22 +75,22 @@ namespace sprout {
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container const&> >::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container const&> >::type
|
||||||
sub(
|
sub(
|
||||||
Container const& arr,
|
Container const& arr,
|
||||||
typename sprout::container_traits<sprout::sub_array<Container const&> >::difference_type first
|
typename sprout::container_traits<sprout::sub_array<Container const&> >::difference_type to_first,
|
||||||
|
typename sprout::container_traits<sprout::sub_array<Container const&> >::difference_type to_last
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return sprout::sub(arr, first, sprout::size(arr));
|
return sprout::sub_window(arr, to_first, to_last);
|
||||||
}
|
}
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container const&> >::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container const&> >::type
|
||||||
sub(
|
sub(
|
||||||
Container const& arr
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<sprout::sub_array<Container const&> >::difference_type to_first = 0
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return sprout::sub(arr, sprout::begin(arr), sprout::end(arr));
|
return sprout::sub_window(arr, to_first);
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// sub
|
|
||||||
//
|
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, Container>::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, Container>::type
|
||||||
sub(
|
sub(
|
||||||
|
@ -122,16 +103,6 @@ namespace sprout {
|
||||||
}
|
}
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, Container>::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, Container>::type
|
||||||
sub(
|
|
||||||
Container const& arr,
|
|
||||||
typename sprout::container_traits<Container>::difference_type first,
|
|
||||||
typename sprout::container_traits<Container>::difference_type last
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return Container(arr, first, last);
|
|
||||||
}
|
|
||||||
template<typename Container>
|
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, Container>::type
|
|
||||||
sub(
|
sub(
|
||||||
Container const& arr,
|
Container const& arr,
|
||||||
typename sprout::container_traits<Container>::const_iterator first
|
typename sprout::container_traits<Container>::const_iterator first
|
||||||
|
@ -143,18 +114,20 @@ namespace sprout {
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, Container>::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, Container>::type
|
||||||
sub(
|
sub(
|
||||||
Container const& arr,
|
Container const& arr,
|
||||||
typename sprout::container_traits<Container>::difference_type first
|
typename sprout::container_traits<Container>::difference_type to_first,
|
||||||
|
typename sprout::container_traits<Container>::difference_type to_last
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return sprout::sub(arr, first, sprout::size(arr));
|
return sprout::sub_window(arr, to_first, to_last);
|
||||||
}
|
}
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, Container>::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, Container>::type
|
||||||
sub(
|
sub(
|
||||||
Container const& arr
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<Container>::difference_type to_first = 0
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return sprout::sub(arr, sprout::begin(arr), sprout::end(arr));
|
return sprout::sub_window(arr, to_first);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -172,16 +145,6 @@ namespace sprout {
|
||||||
}
|
}
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container const&> >::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container const&> >::type
|
||||||
csub(
|
|
||||||
Container const& arr,
|
|
||||||
typename sprout::container_traits<sprout::sub_array<Container const&> >::difference_type first,
|
|
||||||
typename sprout::container_traits<sprout::sub_array<Container const&> >::difference_type last
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return sprout::sub_array<Container const&>(arr, first, last);
|
|
||||||
}
|
|
||||||
template<typename Container>
|
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container const&> >::type
|
|
||||||
csub(
|
csub(
|
||||||
Container const& arr,
|
Container const& arr,
|
||||||
typename sprout::container_traits<sprout::sub_array<Container const&> >::const_iterator first
|
typename sprout::container_traits<sprout::sub_array<Container const&> >::const_iterator first
|
||||||
|
@ -193,22 +156,22 @@ namespace sprout {
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container const&> >::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container const&> >::type
|
||||||
csub(
|
csub(
|
||||||
Container const& arr,
|
Container const& arr,
|
||||||
typename sprout::container_traits<sprout::sub_array<Container const&> >::difference_type first
|
typename sprout::container_traits<sprout::sub_array<Container const&> >::difference_type to_first,
|
||||||
|
typename sprout::container_traits<sprout::sub_array<Container const&> >::difference_type to_last
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return sprout::csub(arr, first, sprout::size(arr));
|
return sprout::csub_window(arr, to_first, to_last);
|
||||||
}
|
}
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container const&> >::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container const&> >::type
|
||||||
csub(
|
csub(
|
||||||
Container const& arr
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<sprout::sub_array<Container const&> >::difference_type to_first = 0
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return sprout::csub(arr, sprout::begin(arr), sprout::end(arr));
|
return sprout::csub_window(arr, to_first);
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// csub
|
|
||||||
//
|
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type const&> >::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type const&> >::type
|
||||||
csub(
|
csub(
|
||||||
|
@ -221,20 +184,6 @@ namespace sprout {
|
||||||
}
|
}
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type const&> >::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type const&> >::type
|
||||||
csub(
|
|
||||||
Container const& arr,
|
|
||||||
typename sprout::container_traits<Container>::difference_type first,
|
|
||||||
typename sprout::container_traits<Container>::difference_type last
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return sprout::sub_array<typename Container::internal_type const&>(
|
|
||||||
arr.get_array(),
|
|
||||||
sprout::next(sprout::begin(arr), first),
|
|
||||||
sprout::next(sprout::begin(arr), last)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
template<typename Container>
|
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type const&> >::type
|
|
||||||
csub(
|
csub(
|
||||||
Container const& arr,
|
Container const& arr,
|
||||||
typename sprout::container_traits<Container>::const_iterator first
|
typename sprout::container_traits<Container>::const_iterator first
|
||||||
|
@ -246,18 +195,20 @@ namespace sprout {
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type const&> >::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type const&> >::type
|
||||||
csub(
|
csub(
|
||||||
Container const& arr,
|
Container const& arr,
|
||||||
typename sprout::container_traits<Container>::difference_type first
|
typename sprout::container_traits<Container>::difference_type to_first,
|
||||||
|
typename sprout::container_traits<Container>::difference_type to_last
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return sprout::csub(arr, first, sprout::size(arr));
|
return sprout::csub_window(arr, to_first, to_last);
|
||||||
}
|
}
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type const&> >::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type const&> >::type
|
||||||
csub(
|
csub(
|
||||||
Container const& arr
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<Container>::difference_type to_first = 0
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return sprout::csub(arr, sprout::begin(arr), sprout::end(arr));
|
return sprout::csub_window(arr, to_first);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -275,16 +226,6 @@ namespace sprout {
|
||||||
}
|
}
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container> >::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container> >::type
|
||||||
sub_copy(
|
|
||||||
Container const& arr,
|
|
||||||
typename sprout::container_traits<Container>::difference_type first,
|
|
||||||
typename sprout::container_traits<Container>::difference_type last
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return sprout::sub_array<Container>(arr, first, last);
|
|
||||||
}
|
|
||||||
template<typename Container>
|
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container> >::type
|
|
||||||
sub_copy(
|
sub_copy(
|
||||||
Container const& arr,
|
Container const& arr,
|
||||||
typename sprout::container_traits<Container>::const_iterator first
|
typename sprout::container_traits<Container>::const_iterator first
|
||||||
|
@ -296,22 +237,22 @@ namespace sprout {
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container> >::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container> >::type
|
||||||
sub_copy(
|
sub_copy(
|
||||||
Container const& arr,
|
Container const& arr,
|
||||||
typename sprout::container_traits<Container>::difference_type first
|
typename sprout::container_traits<Container>::difference_type to_first,
|
||||||
|
typename sprout::container_traits<Container>::difference_type to_last
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return sprout::sub_copy(arr, first, sprout::size(arr));
|
return sprout::sub_window_copy(arr, to_first, to_last);
|
||||||
}
|
}
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container> >::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container> >::type
|
||||||
ub_copy(
|
sub_copy(
|
||||||
Container const& arr
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<Container>::difference_type to_first = 0
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return sprout::sub_copy(arr, sprout::begin(arr), sprout::end(arr));
|
return sprout::sub_window_copy(arr, to_first);
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// sub_copy
|
|
||||||
//
|
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type> >::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type> >::type
|
||||||
sub_copy(
|
sub_copy(
|
||||||
|
@ -324,20 +265,6 @@ namespace sprout {
|
||||||
}
|
}
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type> >::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type> >::type
|
||||||
sub_copy(
|
|
||||||
Container const& arr,
|
|
||||||
typename sprout::container_traits<Container>::difference_type first,
|
|
||||||
typename sprout::container_traits<Container>::difference_type last
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return sprout::sub_array<typename Container::internal_type>(
|
|
||||||
arr.get_array(),
|
|
||||||
sprout::next(sprout::begin(arr), first),
|
|
||||||
sprout::next(sprout::begin(arr), last)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
template<typename Container>
|
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type> >::type
|
|
||||||
sub_copy(
|
sub_copy(
|
||||||
Container const& arr,
|
Container const& arr,
|
||||||
typename sprout::container_traits<Container>::const_iterator first
|
typename sprout::container_traits<Container>::const_iterator first
|
||||||
|
@ -349,18 +276,20 @@ namespace sprout {
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type> >::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type> >::type
|
||||||
sub_copy(
|
sub_copy(
|
||||||
Container const& arr,
|
Container const& arr,
|
||||||
typename sprout::container_traits<Container>::difference_type first
|
typename sprout::container_traits<Container>::difference_type to_first,
|
||||||
|
typename sprout::container_traits<Container>::difference_type to_last
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return sprout::sub_copy(arr, first, sprout::size(arr));
|
return sprout::sub_window_copy(arr, to_first, to_last);
|
||||||
}
|
}
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type> >::type
|
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type> >::type
|
||||||
sub_copy(
|
sub_copy(
|
||||||
Container const& arr
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<Container>::difference_type to_first = 0
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return sprout::sub_copy(arr, sprout::begin(arr), sprout::end(arr));
|
return sprout::sub_window_copy(arr, to_first);
|
||||||
}
|
}
|
||||||
} // namespace sprout
|
} // namespace sprout
|
||||||
|
|
||||||
|
|
|
@ -98,8 +98,8 @@ namespace sprout {
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
holder_type array_;
|
holder_type array_;
|
||||||
impl_difference_type first_;
|
impl_difference_type to_first_;
|
||||||
impl_difference_type last_;
|
impl_difference_type to_last_;
|
||||||
public:
|
public:
|
||||||
sub_array_impl() = default;
|
sub_array_impl() = default;
|
||||||
protected:
|
protected:
|
||||||
|
@ -113,8 +113,8 @@ namespace sprout {
|
||||||
typename std::enable_if<std::is_same<ContainerTag, sprout::detail::is_non_reference_array_tag>::value>::type* = 0
|
typename std::enable_if<std::is_same<ContainerTag, sprout::detail::is_non_reference_array_tag>::value>::type* = 0
|
||||||
)
|
)
|
||||||
: array_{to_holder<Container>(arr)[Indexes]...}
|
: array_{to_holder<Container>(arr)[Indexes]...}
|
||||||
, first_(sprout::distance(sprout::cbegin(arr), first))
|
, to_first_(sprout::distance(sprout::cbegin(arr), first))
|
||||||
, last_(sprout::distance(sprout::cbegin(arr), last))
|
, to_last_(sprout::distance(sprout::cbegin(arr), last))
|
||||||
{}
|
{}
|
||||||
template<typename ContainerTag, sprout::index_t... Indexes>
|
template<typename ContainerTag, sprout::index_t... Indexes>
|
||||||
SPROUT_CONSTEXPR sub_array_impl(
|
SPROUT_CONSTEXPR sub_array_impl(
|
||||||
|
@ -126,34 +126,34 @@ namespace sprout {
|
||||||
typename std::enable_if<!std::is_same<ContainerTag, sprout::detail::is_non_reference_array_tag>::value>::type* = 0
|
typename std::enable_if<!std::is_same<ContainerTag, sprout::detail::is_non_reference_array_tag>::value>::type* = 0
|
||||||
)
|
)
|
||||||
: array_(to_holder<Container>(arr))
|
: array_(to_holder<Container>(arr))
|
||||||
, first_(sprout::distance(sprout::cbegin(arr), first))
|
, to_first_(sprout::distance(sprout::cbegin(arr), first))
|
||||||
, last_(sprout::distance(sprout::cbegin(arr), last))
|
, to_last_(sprout::distance(sprout::cbegin(arr), last))
|
||||||
{}
|
{}
|
||||||
template<typename ContainerTag, sprout::index_t... Indexes>
|
template<typename ContainerTag, sprout::index_t... Indexes>
|
||||||
SPROUT_CONSTEXPR sub_array_impl(
|
SPROUT_CONSTEXPR sub_array_impl(
|
||||||
ContainerTag,
|
ContainerTag,
|
||||||
param_type arr,
|
param_type arr,
|
||||||
sprout::index_tuple<Indexes...>,
|
sprout::index_tuple<Indexes...>,
|
||||||
impl_difference_type first,
|
impl_difference_type to_first,
|
||||||
impl_difference_type last,
|
impl_difference_type to_last,
|
||||||
typename std::enable_if<std::is_same<ContainerTag, sprout::detail::is_non_reference_array_tag>::value>::type* = 0
|
typename std::enable_if<std::is_same<ContainerTag, sprout::detail::is_non_reference_array_tag>::value>::type* = 0
|
||||||
)
|
)
|
||||||
: array_{to_holder<Container>(arr)[Indexes]...}
|
: array_{to_holder<Container>(arr)[Indexes]...}
|
||||||
, first_(first)
|
, to_first_(to_first)
|
||||||
, last_(last)
|
, to_last_(to_last)
|
||||||
{}
|
{}
|
||||||
template<typename ContainerTag, sprout::index_t... Indexes>
|
template<typename ContainerTag, sprout::index_t... Indexes>
|
||||||
SPROUT_CONSTEXPR sub_array_impl(
|
SPROUT_CONSTEXPR sub_array_impl(
|
||||||
ContainerTag,
|
ContainerTag,
|
||||||
param_type arr,
|
param_type arr,
|
||||||
sprout::index_tuple<Indexes...>,
|
sprout::index_tuple<Indexes...>,
|
||||||
impl_difference_type first,
|
impl_difference_type to_first,
|
||||||
impl_difference_type last,
|
impl_difference_type to_last,
|
||||||
typename std::enable_if<!std::is_same<ContainerTag, sprout::detail::is_non_reference_array_tag>::value>::type* = 0
|
typename std::enable_if<!std::is_same<ContainerTag, sprout::detail::is_non_reference_array_tag>::value>::type* = 0
|
||||||
)
|
)
|
||||||
: array_(to_holder<Container>(arr))
|
: array_(to_holder<Container>(arr))
|
||||||
, first_(first)
|
, to_first_(to_first)
|
||||||
, last_(last)
|
, to_last_(to_last)
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
@ -194,8 +194,8 @@ namespace sprout {
|
||||||
typedef typename impl_type::array_tag array_tag;
|
typedef typename impl_type::array_tag array_tag;
|
||||||
private:
|
private:
|
||||||
using impl_type::array_;
|
using impl_type::array_;
|
||||||
using impl_type::first_;
|
using impl_type::to_first_;
|
||||||
using impl_type::last_;
|
using impl_type::to_last_;
|
||||||
public:
|
public:
|
||||||
// construct/copy/destroy:
|
// construct/copy/destroy:
|
||||||
sub_array() = default;
|
sub_array() = default;
|
||||||
|
@ -208,13 +208,13 @@ namespace sprout {
|
||||||
last
|
last
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
SPROUT_CONSTEXPR sub_array(param_type arr, difference_type first, difference_type last)
|
SPROUT_CONSTEXPR sub_array(param_type arr, difference_type to_first, difference_type to_last)
|
||||||
: impl_type(
|
: impl_type(
|
||||||
array_tag(),
|
array_tag(),
|
||||||
arr,
|
arr,
|
||||||
sprout::index_range<0, enumerable_size>::make(),
|
sprout::index_range<0, enumerable_size>::make(),
|
||||||
first,
|
to_first,
|
||||||
last
|
to_last
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
SPROUT_CONSTEXPR sub_array(sub_array const& other, const_iterator first, const_iterator last)
|
SPROUT_CONSTEXPR sub_array(sub_array const& other, const_iterator first, const_iterator last)
|
||||||
|
@ -226,13 +226,13 @@ namespace sprout {
|
||||||
sprout::distance(sprout::begin(other.get_array()), last)
|
sprout::distance(sprout::begin(other.get_array()), last)
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
SPROUT_CONSTEXPR sub_array(sub_array const& other, difference_type first, difference_type last)
|
SPROUT_CONSTEXPR sub_array(sub_array const& other, difference_type to_first, difference_type to_last)
|
||||||
: impl_type(
|
: impl_type(
|
||||||
array_tag(),
|
array_tag(),
|
||||||
impl_type::template to_param<Container>(other.array_),
|
impl_type::template to_param<Container>(other.array_),
|
||||||
sprout::index_range<0, enumerable_size>::make(),
|
sprout::index_range<0, enumerable_size>::make(),
|
||||||
first + other.first_,
|
other.to_first_ + to_first,
|
||||||
last + other.first_
|
other.to_first_ + to_last
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
@ -244,89 +244,89 @@ namespace sprout {
|
||||||
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(other.array_, array_)))
|
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(other.array_, array_)))
|
||||||
{
|
{
|
||||||
sprout::swap(other.array_, array_);
|
sprout::swap(other.array_, array_);
|
||||||
sprout::swap(other.first_, first_);
|
sprout::swap(other.to_first_, to_first_);
|
||||||
sprout::swap(other.last_, last_);
|
sprout::swap(other.to_last_, to_last_);
|
||||||
}
|
}
|
||||||
// iterators:
|
// iterators:
|
||||||
iterator begin() {
|
iterator begin() {
|
||||||
return sprout::next(sprout::begin(get_array()), first_);
|
return sprout::next(sprout::begin(get_array()), to_first_);
|
||||||
}
|
}
|
||||||
SPROUT_CONSTEXPR const_iterator begin() const {
|
SPROUT_CONSTEXPR const_iterator begin() const {
|
||||||
return sprout::next(sprout::begin(get_array()), first_);
|
return sprout::next(sprout::begin(get_array()), to_first_);
|
||||||
}
|
}
|
||||||
iterator end() {
|
iterator end() {
|
||||||
return sprout::next(sprout::begin(get_array()), last_);
|
return sprout::next(sprout::begin(get_array()), to_last_);
|
||||||
}
|
}
|
||||||
SPROUT_CONSTEXPR const_iterator end() const {
|
SPROUT_CONSTEXPR const_iterator end() const {
|
||||||
return sprout::next(sprout::begin(get_array()), last_);
|
return sprout::next(sprout::begin(get_array()), to_last_);
|
||||||
}
|
}
|
||||||
SPROUT_CONSTEXPR const_iterator cbegin() const {
|
SPROUT_CONSTEXPR const_iterator cbegin() const {
|
||||||
return sprout::next(sprout::begin(get_array()), first_);
|
return sprout::next(sprout::begin(get_array()), to_first_);
|
||||||
}
|
}
|
||||||
SPROUT_CONSTEXPR const_iterator cend() const {
|
SPROUT_CONSTEXPR const_iterator cend() const {
|
||||||
return sprout::next(sprout::begin(get_array()), last_);
|
return sprout::next(sprout::begin(get_array()), to_last_);
|
||||||
}
|
}
|
||||||
// capacity:
|
// capacity:
|
||||||
SPROUT_CONSTEXPR size_type size() const {
|
SPROUT_CONSTEXPR size_type size() const {
|
||||||
return last_ - first_;
|
return to_last_ - to_first_;
|
||||||
}
|
}
|
||||||
SPROUT_CONSTEXPR size_type max_size() const {
|
SPROUT_CONSTEXPR size_type max_size() const {
|
||||||
return size();
|
return size();
|
||||||
}
|
}
|
||||||
SPROUT_CONSTEXPR bool empty() const {
|
SPROUT_CONSTEXPR bool empty() const {
|
||||||
return first_ == last_;
|
return to_first_ == to_last_;
|
||||||
}
|
}
|
||||||
// element access:
|
// element access:
|
||||||
reference operator[](size_type i) {
|
reference operator[](size_type i) {
|
||||||
return *sprout::next(sprout::begin(get_array()), first_ + i);
|
return *sprout::next(sprout::begin(get_array()), to_first_ + i);
|
||||||
}
|
}
|
||||||
SPROUT_CONSTEXPR const_reference operator[](size_type i) const {
|
SPROUT_CONSTEXPR const_reference operator[](size_type i) const {
|
||||||
return *sprout::next(sprout::begin(get_array()), first_ + i);
|
return *sprout::next(sprout::begin(get_array()), to_first_ + i);
|
||||||
}
|
}
|
||||||
reference at(size_type i) {
|
reference at(size_type i) {
|
||||||
return i < size()
|
return i < size()
|
||||||
? *sprout::next(sprout::begin(get_array()), first_ + i)
|
? *sprout::next(sprout::begin(get_array()), to_first_ + i)
|
||||||
: (throw std::out_of_range("sub_array<>: index out of range"), *sprout::next(sprout::begin(get_array()), first_ + i))
|
: (throw std::out_of_range("sub_array<>: index out of range"), *sprout::next(sprout::begin(get_array()), to_first_ + i))
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
SPROUT_CONSTEXPR const_reference at(size_type i) const {
|
SPROUT_CONSTEXPR const_reference at(size_type i) const {
|
||||||
return i < size()
|
return i < size()
|
||||||
? *sprout::next(sprout::begin(get_array()), first_ + i)
|
? *sprout::next(sprout::begin(get_array()), to_first_ + i)
|
||||||
: (throw std::out_of_range("sub_array<>: index out of range"), *sprout::next(sprout::begin(get_array()), first_ + i))
|
: (throw std::out_of_range("sub_array<>: index out of range"), *sprout::next(sprout::begin(get_array()), to_first_ + i))
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
reference front() {
|
reference front() {
|
||||||
return *sprout::next(sprout::begin(get_array()), first_);
|
return *sprout::next(sprout::begin(get_array()), to_first_);
|
||||||
}
|
}
|
||||||
SPROUT_CONSTEXPR const_reference front() const {
|
SPROUT_CONSTEXPR const_reference front() const {
|
||||||
return *sprout::next(sprout::begin(get_array()), first_);
|
return *sprout::next(sprout::begin(get_array()), to_first_);
|
||||||
}
|
}
|
||||||
reference back() {
|
reference back() {
|
||||||
return *sprout::next(sprout::begin(get_array()), last_ - 1);
|
return *sprout::next(sprout::begin(get_array()), to_last_ - 1);
|
||||||
}
|
}
|
||||||
SPROUT_CONSTEXPR const_reference back() const {
|
SPROUT_CONSTEXPR const_reference back() const {
|
||||||
return *sprout::next(sprout::begin(get_array()), last_ - 1);
|
return *sprout::next(sprout::begin(get_array()), to_last_ - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
pointer data() {
|
pointer data() {
|
||||||
return get_array().data() + first_;
|
return get_array().data() + to_first_;
|
||||||
}
|
}
|
||||||
SPROUT_CONSTEXPR const_pointer data() const {
|
SPROUT_CONSTEXPR const_pointer data() const {
|
||||||
return get_array().data() + first_;
|
return get_array().data() + to_first_;
|
||||||
}
|
}
|
||||||
// others:
|
// others:
|
||||||
template<typename Container2>
|
template<typename Container2>
|
||||||
sub_array& operator=(sub_array<Container2> const& rhs) {
|
sub_array& operator=(sub_array<Container2> const& rhs) {
|
||||||
array_ = rhs.array_;
|
array_ = rhs.array_;
|
||||||
first_ = rhs.first_;
|
to_first_ = rhs.to_first_;
|
||||||
last_ = rhs.last_;
|
to_last_ = rhs.to_last_;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
template<typename Container2>
|
template<typename Container2>
|
||||||
sub_array& operator=(sub_array<Container2>&& rhs) {
|
sub_array& operator=(sub_array<Container2>&& rhs) {
|
||||||
array_ = std::move(rhs.array_);
|
array_ = std::move(rhs.array_);
|
||||||
first_ = std::move(rhs.first_);
|
to_first_ = std::move(rhs.to_first_);
|
||||||
last_ = std::move(rhs.last_);
|
to_last_ = std::move(rhs.to_last_);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
pointer c_array() {
|
pointer c_array() {
|
||||||
|
@ -353,6 +353,12 @@ namespace sprout {
|
||||||
SPROUT_CONSTEXPR const_param_type get_array() const {
|
SPROUT_CONSTEXPR const_param_type get_array() const {
|
||||||
return impl_type::template to_const_param<Container>(array_);
|
return impl_type::template to_const_param<Container>(array_);
|
||||||
}
|
}
|
||||||
|
SPROUT_CONSTEXPR difference_type to_first() const {
|
||||||
|
return to_first_;
|
||||||
|
}
|
||||||
|
SPROUT_CONSTEXPR difference_type to_last() const {
|
||||||
|
return to_last_;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
SPROUT_CONSTEXPR_OR_CONST typename sprout::sub_array<Container>::size_type sprout::sub_array<Container>::enumerable_size;
|
SPROUT_CONSTEXPR_OR_CONST typename sprout::sub_array<Container>::size_type sprout::sub_array<Container>::enumerable_size;
|
||||||
|
|
103
sprout/sub_array/sub_offset.hpp
Normal file
103
sprout/sub_array/sub_offset.hpp
Normal file
|
@ -0,0 +1,103 @@
|
||||||
|
#ifndef SPROUT_SUB_ARRAY_SUB_OFFSET_HPP
|
||||||
|
#define SPROUT_SUB_ARRAY_SUB_OFFSET_HPP
|
||||||
|
|
||||||
|
#include <type_traits>
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/traits.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
|
#include <sprout/sub_array/type_traits.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
//
|
||||||
|
// sub_offset
|
||||||
|
//
|
||||||
|
template<typename Container>
|
||||||
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container&> >::type
|
||||||
|
sub_offset(
|
||||||
|
Container& arr,
|
||||||
|
typename sprout::container_traits<sprout::sub_array<Container&> >::difference_type from_begin = 0,
|
||||||
|
typename sprout::container_traits<sprout::sub_array<Container&> >::difference_type from_end = 0
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return sprout::sub_array<Container&>(arr, from_begin, sprout::size(arr) + from_end);
|
||||||
|
}
|
||||||
|
template<typename Container>
|
||||||
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container const&> >::type
|
||||||
|
sub_offset(
|
||||||
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<sprout::sub_array<Container const&> >::difference_type from_begin = 0,
|
||||||
|
typename sprout::container_traits<sprout::sub_array<Container const&> >::difference_type from_end = 0
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return sprout::sub_array<Container const&>(arr, from_begin, sprout::size(arr) + from_end);
|
||||||
|
}
|
||||||
|
template<typename Container>
|
||||||
|
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, Container>::type
|
||||||
|
sub_offset(
|
||||||
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<Container>::difference_type from_begin = 0,
|
||||||
|
typename sprout::container_traits<Container>::difference_type from_end = 0
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return Container(arr, from_begin, sprout::size(arr) + from_end);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// csub_offset
|
||||||
|
//
|
||||||
|
template<typename Container>
|
||||||
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container const&> >::type
|
||||||
|
csub_offset(
|
||||||
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<sprout::sub_array<Container const&> >::difference_type from_begin = 0,
|
||||||
|
typename sprout::container_traits<sprout::sub_array<Container const&> >::difference_type from_end = 0
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return sprout::sub_offset(arr, from_begin, from_end);
|
||||||
|
}
|
||||||
|
template<typename Container>
|
||||||
|
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type const&> >::type
|
||||||
|
csub_offset(
|
||||||
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<Container>::difference_type from_begin = 0,
|
||||||
|
typename sprout::container_traits<Container>::difference_type from_end = 0
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return sprout::sub_array<typename Container::internal_type const&>(
|
||||||
|
arr.get_array(),
|
||||||
|
arr.to_first() + from_begin,
|
||||||
|
arr.to_last() + from_end
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// sub_offset_copy
|
||||||
|
//
|
||||||
|
template<typename Container>
|
||||||
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container> >::type
|
||||||
|
sub_offset_copy(
|
||||||
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<Container>::difference_type from_begin = 0,
|
||||||
|
typename sprout::container_traits<Container>::difference_type from_end = 0
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return sprout::sub_array<Container>(arr, from_begin, sprout::size(arr) + from_end);
|
||||||
|
}
|
||||||
|
template<typename Container>
|
||||||
|
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type> >::type
|
||||||
|
sub_offset_copy(
|
||||||
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<Container>::difference_type from_begin = 0,
|
||||||
|
typename sprout::container_traits<Container>::difference_type from_end = 0
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return sprout::sub_array<typename Container::internal_type>(
|
||||||
|
arr.get_array(),
|
||||||
|
arr.to_first() + from_begin,
|
||||||
|
arr.to_last() + from_end
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_SUB_ARRAY_SUB_OFFSET_HPP
|
174
sprout/sub_array/sub_window.hpp
Normal file
174
sprout/sub_array/sub_window.hpp
Normal file
|
@ -0,0 +1,174 @@
|
||||||
|
#ifndef SPROUT_SUB_ARRAY_SUB_WINDOW_HPP
|
||||||
|
#define SPROUT_SUB_ARRAY_SUB_WINDOW_HPP
|
||||||
|
|
||||||
|
#include <type_traits>
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/traits.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/sub_array/sub_array.hpp>
|
||||||
|
#include <sprout/sub_array/type_traits.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
//
|
||||||
|
// sub_window
|
||||||
|
//
|
||||||
|
template<typename Container>
|
||||||
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container&> >::type
|
||||||
|
sub_window(
|
||||||
|
Container& arr,
|
||||||
|
typename sprout::container_traits<sprout::sub_array<Container&> >::difference_type to_first,
|
||||||
|
typename sprout::container_traits<sprout::sub_array<Container&> >::difference_type to_last
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return sprout::sub_array<Container&>(arr, to_first, to_last);
|
||||||
|
}
|
||||||
|
template<typename Container>
|
||||||
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container&> >::type
|
||||||
|
sub_window(
|
||||||
|
Container& arr,
|
||||||
|
typename sprout::container_traits<sprout::sub_array<Container&> >::difference_type to_first = 0
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return sprout::sub_array<Container&>(arr, to_first, sprout::size(arr));
|
||||||
|
}
|
||||||
|
template<typename Container>
|
||||||
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container const&> >::type
|
||||||
|
sub_window(
|
||||||
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<sprout::sub_array<Container const&> >::difference_type to_first,
|
||||||
|
typename sprout::container_traits<sprout::sub_array<Container const&> >::difference_type to_last
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return sprout::sub_array<Container const&>(arr, to_first, to_last);
|
||||||
|
}
|
||||||
|
template<typename Container>
|
||||||
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container const&> >::type
|
||||||
|
sub_window(
|
||||||
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<sprout::sub_array<Container const&> >::difference_type to_first = 0
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return sprout::sub_array<Container const&>(arr, to_first, sprout::size(arr));
|
||||||
|
}
|
||||||
|
template<typename Container>
|
||||||
|
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, Container>::type
|
||||||
|
sub_window(
|
||||||
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<Container>::difference_type to_first,
|
||||||
|
typename sprout::container_traits<Container>::difference_type to_last
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return Container(arr, to_first, to_last);
|
||||||
|
}
|
||||||
|
template<typename Container>
|
||||||
|
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, Container>::type
|
||||||
|
sub_window(
|
||||||
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<Container>::difference_type to_first = 0
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return Container(arr, to_first, sprout::size(arr));
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// csub_window
|
||||||
|
//
|
||||||
|
template<typename Container>
|
||||||
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container const&> >::type
|
||||||
|
csub_window(
|
||||||
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<sprout::sub_array<Container const&> >::difference_type to_first,
|
||||||
|
typename sprout::container_traits<sprout::sub_array<Container const&> >::difference_type to_last
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return sprout::sub_window(arr, to_first, to_last);
|
||||||
|
}
|
||||||
|
template<typename Container>
|
||||||
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container const&> >::type
|
||||||
|
csub_window(
|
||||||
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<sprout::sub_array<Container const&> >::difference_type to_first = 0
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return sprout::sub_window(arr, to_first, sprout::size(arr));
|
||||||
|
}
|
||||||
|
template<typename Container>
|
||||||
|
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type const&> >::type
|
||||||
|
csub_window(
|
||||||
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<Container>::difference_type to_first,
|
||||||
|
typename sprout::container_traits<Container>::difference_type to_last
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return sprout::sub_array<typename Container::internal_type const&>(
|
||||||
|
arr.get_array(),
|
||||||
|
arr.to_first() + to_first,
|
||||||
|
arr.to_first() + to_last
|
||||||
|
);
|
||||||
|
}
|
||||||
|
template<typename Container>
|
||||||
|
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type const&> >::type
|
||||||
|
csub_window(
|
||||||
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<Container>::difference_type to_first = 0
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return sprout::sub_array<typename Container::internal_type const&>(
|
||||||
|
arr.get_array(),
|
||||||
|
arr.to_first() + to_first,
|
||||||
|
arr.to_first() + sprout::size(arr)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// sub_window_copy
|
||||||
|
//
|
||||||
|
template<typename Container>
|
||||||
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container> >::type
|
||||||
|
sub_window_copy(
|
||||||
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<Container>::difference_type to_first,
|
||||||
|
typename sprout::container_traits<Container>::difference_type to_last
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return sprout::sub_array<Container>(arr, to_first, to_last);
|
||||||
|
}
|
||||||
|
template<typename Container>
|
||||||
|
inline SPROUT_CONSTEXPR typename std::enable_if<!sprout::is_sub_array<Container>::value, sprout::sub_array<Container> >::type
|
||||||
|
sub_window_copy(
|
||||||
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<Container>::difference_type to_first = 0
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return sprout::sub_array<Container>(arr, to_first, sprout::size(arr));
|
||||||
|
}
|
||||||
|
template<typename Container>
|
||||||
|
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type> >::type
|
||||||
|
sub_window_copy(
|
||||||
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<Container>::difference_type to_first,
|
||||||
|
typename sprout::container_traits<Container>::difference_type to_last
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return sprout::sub_array<typename Container::internal_type>(
|
||||||
|
arr.get_array(),
|
||||||
|
arr.to_first() + to_first,
|
||||||
|
arr.to_first() + to_last
|
||||||
|
);
|
||||||
|
}
|
||||||
|
template<typename Container>
|
||||||
|
inline SPROUT_CONSTEXPR typename std::enable_if<sprout::is_sub_array<Container>::value, sprout::sub_array<typename Container::internal_type> >::type
|
||||||
|
sub_window_copy(
|
||||||
|
Container const& arr,
|
||||||
|
typename sprout::container_traits<Container>::difference_type to_first = 0
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return sprout::sub_array<typename Container::internal_type>(
|
||||||
|
arr.get_array(),
|
||||||
|
arr.to_first() + to_first,
|
||||||
|
arr.to_first() + sprout::size(arr)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_SUB_ARRAY_SUB_WINDOW_HPP
|
Loading…
Add table
Reference in a new issue