fix recursion depth: some algorithms

This commit is contained in:
bolero-MURAKAMI 2013-01-11 02:55:19 +09:00
parent bb59363682
commit e2b207d3be
34 changed files with 796 additions and 87 deletions

View file

@ -44,6 +44,74 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(result);
}
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_partitioned(
testspr::reduct_input(sprout::begin(arr1)),
testspr::reduct_input(sprout::end(arr1)),
testspr::is_odd<int>()
);
TESTSPR_BOTH_ASSERT(result);
}
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_partitioned(
testspr::reduct_input(sprout::begin(arr1)),
testspr::reduct_input(sprout::end(arr1)),
testspr::less_than<int>(6)
);
TESTSPR_BOTH_ASSERT(!result);
}
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_partitioned(
testspr::reduct_input(sprout::begin(arr1)),
testspr::reduct_input(sprout::begin(arr1) + 5),
testspr::is_odd<int>()
);
TESTSPR_BOTH_ASSERT(result);
}
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_partitioned(
testspr::reduct_input(sprout::begin(arr1)),
testspr::reduct_input(sprout::begin(arr1) + 5),
testspr::less_than<int>(6)
);
TESTSPR_BOTH_ASSERT(result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_partitioned(
testspr::reduct_random_access(sprout::begin(arr1)),
testspr::reduct_random_access(sprout::end(arr1)),
testspr::is_odd<int>()
);
TESTSPR_BOTH_ASSERT(result);
}
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_partitioned(
testspr::reduct_random_access(sprout::begin(arr1)),
testspr::reduct_random_access(sprout::end(arr1)),
testspr::less_than<int>(6)
);
TESTSPR_BOTH_ASSERT(!result);
}
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_partitioned(
testspr::reduct_random_access(sprout::begin(arr1)),
testspr::reduct_random_access(sprout::begin(arr1) + 5),
testspr::is_odd<int>()
);
TESTSPR_BOTH_ASSERT(result);
}
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::is_partitioned(
testspr::reduct_random_access(sprout::begin(arr1)),
testspr::reduct_random_access(sprout::begin(arr1) + 5),
testspr::less_than<int>(6)
);
TESTSPR_BOTH_ASSERT(result);
}
#endif
}
}
} // namespace testspr