extraordinary fix: find_end implementation

This commit is contained in:
bolero-MURAKAMI 2013-08-12 00:09:40 +09:00
parent 7c8f28115c
commit 72fe72a623
45 changed files with 68 additions and 171 deletions

View file

@ -83,7 +83,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto found = sprout::adjacent_find(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -115,7 +114,6 @@ namespace testspr {
).base();
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#endif
}
}
} // namespace testspr

View file

@ -85,7 +85,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::all_of(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -118,7 +117,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(result);
}
#endif
}
}
} // namespace testspr

View file

@ -53,7 +53,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::all_of_equal(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -70,7 +69,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(result);
}
#endif
}
}
} // namespace testspr

View file

@ -85,7 +85,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(!result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::any_of(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -118,7 +117,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(!result);
}
#endif
}
}
} // namespace testspr

View file

@ -85,7 +85,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(!result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::any_of_equal(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -118,7 +117,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(!result);
}
#endif
}
}
} // namespace testspr

View file

@ -37,7 +37,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(!result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::binary_search(
testspr::reduct_forward(sprout::begin(arr1)),
@ -55,9 +54,7 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(!result);
}
#endif
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::binary_search(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -75,7 +72,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(!result);
}
#endif
}
}
} // namespace testspr

View file

@ -85,7 +85,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(result == 0);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::count(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -118,7 +117,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(result == 0);
}
#endif
}
}
} // namespace testspr

View file

@ -85,7 +85,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(result == 5);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::count_if(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -118,7 +117,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(result == 5);
}
#endif
}
}
} // namespace testspr

View file

@ -161,7 +161,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::equal(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -231,7 +230,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(result);
}
#endif
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::equal(
@ -388,7 +386,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::equal(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -466,7 +463,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(result);
}
#endif
}
}
} // namespace testspr

View file

@ -64,7 +64,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(sprout::distance(found.first.base(), found.second.base()) == 0);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto found = sprout::equal_range(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -86,7 +85,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(found.second.base() == sprout::begin(arr1) + 5);
TESTSPR_BOTH_ASSERT(sprout::distance(found.first.base(), found.second.base()) == 0);
}
#endif
}
}
} // namespace testspr

View file

@ -85,7 +85,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto found = sprout::find(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -118,7 +117,6 @@ namespace testspr {
).base();
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#endif
}
}
} // namespace testspr

View file

@ -177,7 +177,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto found = sprout::find_end(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -218,7 +217,6 @@ namespace testspr {
).base();
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#endif
}
}
} // namespace testspr

View file

@ -177,7 +177,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto found = sprout::find_first_of(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -255,7 +254,6 @@ namespace testspr {
).base();
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#endif
}
}
} // namespace testspr

View file

@ -85,7 +85,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto found = sprout::find_if(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -118,7 +117,6 @@ namespace testspr {
).base();
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#endif
}
}
} // namespace testspr

View file

@ -85,7 +85,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto found = sprout::find_if_not(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -118,7 +117,6 @@ namespace testspr {
).base();
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#endif
}
}
} // namespace testspr

View file

@ -99,7 +99,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(!result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::includes(
testspr::reduct_input(sprout::begin(arr1)),
@ -177,9 +176,7 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(!result);
}
#endif
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::includes(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -257,7 +254,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(!result);
}
#endif
}
}
} // namespace testspr

View file

@ -34,7 +34,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_decreasing(
testspr::reduct_forward(sprout::begin(arr1)),
@ -49,9 +48,7 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(result);
}
#endif
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_decreasing(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -66,7 +63,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(result);
}
#endif
}
}
} // namespace testspr

View file

@ -81,7 +81,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_heap(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -142,7 +141,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(result);
}
#endif
}
}
} // namespace testspr

View file

@ -81,7 +81,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr2) + 5);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto found = sprout::is_heap_until(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -142,7 +141,6 @@ namespace testspr {
).base();
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr2) + 5);
}
#endif
}
}
} // namespace testspr

View file

@ -34,7 +34,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_increasing(
testspr::reduct_forward(sprout::begin(arr1)),
@ -49,9 +48,7 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(result);
}
#endif
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_increasing(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -66,7 +63,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(result);
}
#endif
}
}
} // namespace testspr

View file

@ -85,7 +85,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_partitioned(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -118,7 +117,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(result);
}
#endif
}
}
} // namespace testspr

View file

@ -161,7 +161,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_permutation(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -231,7 +230,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(result);
}
#endif
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_permutation(
@ -389,7 +387,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_permutation(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -467,7 +464,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(result);
}
#endif
}
}
} // namespace testspr

View file

@ -50,7 +50,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_sorted(
testspr::reduct_forward(sprout::begin(arr1)),
@ -81,9 +80,7 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(result);
}
#endif
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_sorted(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -114,7 +111,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(result);
}
#endif
}
}
} // namespace testspr

View file

@ -81,7 +81,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto found = sprout::is_sorted_until(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -112,7 +111,6 @@ namespace testspr {
).base();
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#endif
}
}
} // namespace testspr

View file

@ -49,7 +49,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(!result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_strictly_decreasing(
testspr::reduct_forward(sprout::begin(arr1)),
@ -78,9 +77,7 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(!result);
}
#endif
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_strictly_decreasing(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -109,7 +106,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(!result);
}
#endif
}
}
} // namespace testspr

View file

@ -49,7 +49,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(!result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_strictly_increasing(
testspr::reduct_forward(sprout::begin(arr1)),
@ -78,9 +77,7 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(!result);
}
#endif
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_strictly_increasing(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -109,7 +106,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(!result);
}
#endif
}
}
} // namespace testspr

View file

@ -156,7 +156,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(!result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::lexicographical_compare(
testspr::reduct_input(sprout::begin(arr1)),
@ -290,9 +289,7 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(!result);
}
#endif
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::lexicographical_compare(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -426,7 +423,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(!result);
}
#endif
}
}
} // namespace testspr

View file

@ -55,7 +55,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto found = sprout::lower_bound(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -73,7 +72,6 @@ namespace testspr {
).base();
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#endif
}
}
} // namespace testspr

View file

@ -81,7 +81,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(result == sprout::begin(arr1) + 4);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::max_element(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -112,7 +111,6 @@ namespace testspr {
).base();
TESTSPR_BOTH_ASSERT(result == sprout::begin(arr1) + 4);
}
#endif
}
}
} // namespace testspr

View file

@ -81,7 +81,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(result == sprout::begin(arr1) + 3);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::min_element(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -112,7 +111,6 @@ namespace testspr {
).base();
TESTSPR_BOTH_ASSERT(result == sprout::begin(arr1) + 3);
}
#endif
}
}
} // namespace testspr

View file

@ -89,7 +89,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(result.second.base() == sprout::begin(arr1) + 4);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::minmax_element(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -124,7 +123,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(result.first.base() == sprout::begin(arr1) + 3);
TESTSPR_BOTH_ASSERT(result.second.base() == sprout::begin(arr1) + 4);
}
#endif
}
}
} // namespace testspr

View file

@ -177,7 +177,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(found.second.base() == sprout::begin(arr2));
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto found = sprout::mismatch(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -255,7 +254,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(found.first.base() == sprout::begin(arr1));
TESTSPR_BOTH_ASSERT(found.second.base() == sprout::begin(arr2));
}
#endif
{
SPROUT_STATIC_CONSTEXPR auto found = sprout::mismatch(
@ -429,7 +427,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(found.second.base() == sprout::begin(arr2));
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto found = sprout::mismatch(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -515,7 +512,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(found.first.base() == sprout::begin(arr1));
TESTSPR_BOTH_ASSERT(found.second.base() == sprout::begin(arr2));
}
#endif
}
}
} // namespace testspr

View file

@ -85,7 +85,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::none_of(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -118,7 +117,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(result);
}
#endif
}
}
} // namespace testspr

View file

@ -85,7 +85,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::none_of_equal(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -118,7 +117,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(result);
}
#endif
}
}
} // namespace testspr

View file

@ -85,7 +85,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(!result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::one_of(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -118,7 +117,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(!result);
}
#endif
}
}
} // namespace testspr

View file

@ -85,7 +85,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(!result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::one_of_equal(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -118,7 +117,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(!result);
}
#endif
}
}
} // namespace testspr

View file

@ -53,7 +53,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto found = sprout::partition_point(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -70,7 +69,6 @@ namespace testspr {
).base();
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#endif
}
}
} // namespace testspr

View file

@ -177,7 +177,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto found = sprout::search(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -255,7 +254,6 @@ namespace testspr {
).base();
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#endif
}
}
} // namespace testspr

View file

@ -175,7 +175,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto found = sprout::search_n(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -253,7 +252,6 @@ namespace testspr {
).base();
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#endif
}
}
} // namespace testspr

View file

@ -156,7 +156,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(result > 0);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::tristate_lexicographical_compare(
testspr::reduct_input(sprout::begin(arr1)),
@ -290,9 +289,7 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(result > 0);
}
#endif
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::tristate_lexicographical_compare(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -426,7 +423,6 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(result > 0);
}
#endif
}
}
} // namespace testspr

View file

@ -55,7 +55,6 @@ namespace testspr {
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto found = sprout::upper_bound(
testspr::reduct_random_access(sprout::begin(arr1)),
@ -73,7 +72,6 @@ namespace testspr {
).base();
TESTSPR_BOTH_ASSERT(found == sprout::begin(arr1) + 5);
}
#endif
}
}
} // namespace testspr

View file

@ -19,70 +19,71 @@
namespace sprout {
namespace detail {
template<typename RandomAccessIterator1>
inline SPROUT_CONSTEXPR RandomAccessIterator1
find_end_impl_check_ra(RandomAccessIterator1 first1, RandomAccessIterator1 result, RandomAccessIterator1 searched) {
return searched == first1 ? searched
: result
;
}
template<typename RandomAccessIterator1, typename ForwardIterator2, typename BinaryPredicate>
inline SPROUT_CONSTEXPR RandomAccessIterator1
find_end_impl_ra(
RandomAccessIterator1 first1, RandomAccessIterator1 last1,
ForwardIterator2 first2, ForwardIterator2 last2,
BinaryPredicate pred,
typename std::iterator_traits<RandomAccessIterator1>::difference_type pivot, RandomAccessIterator1 last1_, RandomAccessIterator1 result,
RandomAccessIterator1 searched
)
{
return searched == last1_ ? result
: searched < first1 ? pivot == 0
? sprout::detail::find_end_impl_check_ra(
first1, searched,
sprout::detail::search_one(first1, last1_, first2, last2, pred)
)
: sprout::detail::find_end_impl_ra(
sprout::next(first1, pivot), last1, first2, last2, pred,
(sprout::distance(first1, last1) - pivot) / 2, last1_, searched,
sprout::detail::find_end_impl_ra(
first1, sprout::next(first1, pivot), first2, last2, pred,
pivot / 2, last1_, searched,
first1
)
)
: pivot == 0 ? sprout::detail::search_one(first1, last1_, first2, last2, pred)
: sprout::detail::find_end_impl_ra(
sprout::next(first1, pivot), last1, first2, last2, pred,
(sprout::distance(first1, last1) - pivot) / 2, last1_, result,
sprout::detail::find_end_impl_ra(
first1, sprout::next(first1, pivot), first2, last2, pred,
pivot / 2, last1_, result,
first1
)
)
;
}
template<typename RandomAccessIterator1, typename ForwardIterator2, typename BinaryPredicate>
inline SPROUT_CONSTEXPR typename std::enable_if<
sprout::is_constant_distance_iterator<RandomAccessIterator1>::value,
RandomAccessIterator1
>::type
find_end(
RandomAccessIterator1 first1, RandomAccessIterator1 last1,
ForwardIterator2 first2, ForwardIterator2 last2,
BinaryPredicate pred,
std::random_access_iterator_tag*
)
{
return first1 == last1 ? last1
: sprout::detail::find_end_impl_ra(
first1, last1, first2, last2, pred,
sprout::distance(first1, last1) / 2, last1, last1,
first1
)
;
}
// !!!
// template<typename RandomAccessIterator1>
// inline SPROUT_CONSTEXPR RandomAccessIterator1
// find_end_impl_check_ra(RandomAccessIterator1 first1, RandomAccessIterator1 result, RandomAccessIterator1 searched) {
// return searched == first1 ? searched
// : result
// ;
// }
// template<typename RandomAccessIterator1, typename ForwardIterator2, typename BinaryPredicate>
// inline SPROUT_CONSTEXPR RandomAccessIterator1
// find_end_impl_ra(
// RandomAccessIterator1 first1, RandomAccessIterator1 last1,
// ForwardIterator2 first2, ForwardIterator2 last2,
// BinaryPredicate pred,
// typename std::iterator_traits<RandomAccessIterator1>::difference_type pivot, RandomAccessIterator1 last1_, RandomAccessIterator1 result,
// RandomAccessIterator1 searched
// )
// {
// return searched == last1_ ? result
// : searched < first1 ? pivot == 0
// ? sprout::detail::find_end_impl_check_ra(
// first1, searched,
// sprout::detail::search_one(first1, last1_, first2, last2, pred)
// )
// : sprout::detail::find_end_impl_ra(
// sprout::next(first1, pivot), last1, first2, last2, pred,
// (sprout::distance(first1, last1) - pivot) / 2, last1_, searched,
// sprout::detail::find_end_impl_ra(
// first1, sprout::next(first1, pivot), first2, last2, pred,
// pivot / 2, last1_, searched,
// first1
// )
// )
// : pivot == 0 ? sprout::detail::search_one(first1, last1_, first2, last2, pred)
// : sprout::detail::find_end_impl_ra(
// sprout::next(first1, pivot), last1, first2, last2, pred,
// (sprout::distance(first1, last1) - pivot) / 2, last1_, result,
// sprout::detail::find_end_impl_ra(
// first1, sprout::next(first1, pivot), first2, last2, pred,
// pivot / 2, last1_, result,
// first1
// )
// )
// ;
// }
// template<typename RandomAccessIterator1, typename ForwardIterator2, typename BinaryPredicate>
// inline SPROUT_CONSTEXPR typename std::enable_if<
// sprout::is_constant_distance_iterator<RandomAccessIterator1>::value,
// RandomAccessIterator1
// >::type
// find_end(
// RandomAccessIterator1 first1, RandomAccessIterator1 last1,
// ForwardIterator2 first2, ForwardIterator2 last2,
// BinaryPredicate pred,
// std::random_access_iterator_tag*
// )
// {
// return first1 == last1 ? last1
// : sprout::detail::find_end_impl_ra(
// first1, last1, first2, last2, pred,
// sprout::distance(first1, last1) / 2, last1, last1,
// first1
// )
// ;
// }
template<typename ForwardIterator1>
inline SPROUT_CONSTEXPR sprout::pair<ForwardIterator1, ForwardIterator1>

View file

@ -14,6 +14,7 @@
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/algorithm/fixed/swap_element.hpp>
#include <sprout/algorithm/fixed/reverse_copy.hpp>
#include <sprout/algorithm/fixed/reverse.hpp>
#include <sprout/sub_array/sub_array.hpp>
#include <sprout/utility/pair/pair.hpp>

View file

@ -14,6 +14,7 @@
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/algorithm/fixed/swap_element.hpp>
#include <sprout/algorithm/fixed/reverse_copy.hpp>
#include <sprout/algorithm/fixed/reverse.hpp>
#include <sprout/sub_array/sub_array.hpp>
#include <sprout/utility/pair/pair.hpp>

View file

@ -20,7 +20,7 @@
//
#ifndef SPROUT_RECURSIVE_FUNCTION_TEMPLATE_INSTANTIATION_LIMIT
# if defined(__clang__)
# if (__clang_major__ < 3 || (__clang_major__ == 3 && __clang_major__ <= 2))
# if (__clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ <= 2))
# define SPROUT_RECURSIVE_FUNCTION_TEMPLATE_INSTANTIATION_LIMIT 512
# else
# define SPROUT_RECURSIVE_FUNCTION_TEMPLATE_INSTANTIATION_LIMIT 256