mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-04 14:14:09 +00:00
algorithm を next/prev で再実装
This commit is contained in:
parent
6fe7e88509
commit
628d1caa7e
50 changed files with 310 additions and 189 deletions
|
@ -5,6 +5,7 @@
|
|||
#include <sprout/config.hpp>
|
||||
#include <sprout/fixed_container/traits.hpp>
|
||||
#include <sprout/fixed_container/functions.hpp>
|
||||
#include <sprout/iterator/operation.hpp>
|
||||
#include <sprout/algorithm/fixed/result_of.hpp>
|
||||
|
||||
namespace sprout {
|
||||
|
@ -30,7 +31,7 @@ namespace sprout {
|
|||
Args const&... args
|
||||
)
|
||||
{
|
||||
return remove_copy_if_impl_3(result, args..., *(sprout::fixed_begin(result) + sizeof...(Args)));
|
||||
return remove_copy_if_impl_3(result, args..., *sprout::next(sprout::fixed_begin(result), sizeof...(Args)));
|
||||
}
|
||||
template<typename Iterator, typename Result, typename Predicate, typename... Args>
|
||||
SPROUT_CONSTEXPR inline typename std::enable_if<
|
||||
|
@ -62,8 +63,8 @@ namespace sprout {
|
|||
{
|
||||
return first != last && sizeof...(Args) < offset
|
||||
? pred(*first)
|
||||
? remove_copy_if_impl_2(first + 1, last, result, pred, offset, args...)
|
||||
: remove_copy_if_impl_2(first + 1, last, result, pred, offset, args..., *first)
|
||||
? remove_copy_if_impl_2(sprout::next(first), last, result, pred, offset, args...)
|
||||
: remove_copy_if_impl_2(sprout::next(first), last, result, pred, offset, args..., *first)
|
||||
: remove_copy_if_impl_3(result, args...)
|
||||
;
|
||||
}
|
||||
|
@ -96,7 +97,7 @@ namespace sprout {
|
|||
)
|
||||
{
|
||||
return sizeof...(Args) < offset
|
||||
? remove_copy_if_impl_1(first, last, result, pred, offset, args..., *(sprout::fixed_begin(result) + sizeof...(Args)))
|
||||
? remove_copy_if_impl_1(first, last, result, pred, offset, args..., *sprout::next(sprout::fixed_begin(result), sizeof...(Args)))
|
||||
: remove_copy_if_impl_2(first, last, result, pred, offset + sprout::size(result), args...)
|
||||
;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue