mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-12 14:54:10 +00:00
range/numeric.hpp 追加
algorithm/* fix
This commit is contained in:
parent
510a265ea5
commit
42d73cc4d5
18 changed files with 407 additions and 131 deletions
|
@ -1,11 +1,12 @@
|
|||
#ifndef SPROUT_ALGORITHM_FIXED_UNIQUE_COPY_HPP
|
||||
#define SPROUT_ALGORITHM_FIXED_UNIQUE_COPY_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/fixed_container/traits.hpp>
|
||||
#include <sprout/fixed_container/functions.hpp>
|
||||
#include <sprout/iterator/operation.hpp>
|
||||
#include <sprout/iterator/operation.hpp>
|
||||
#include <sprout/algorithm/fixed/result_of.hpp>
|
||||
|
||||
namespace sprout {
|
||||
|
@ -46,7 +47,7 @@ namespace sprout {
|
|||
Args const&... args
|
||||
)
|
||||
{
|
||||
return sprout::remake_clone<Result, Result>(result, sprout::size(result), args...);
|
||||
return sprout::remake_clone<Result, Result>(result, sprout::size(result), args..., head);
|
||||
}
|
||||
template<typename InputIterator, typename Result, typename Head, typename... Args>
|
||||
SPROUT_CONSTEXPR inline typename std::enable_if<
|
||||
|
@ -61,7 +62,7 @@ namespace sprout {
|
|||
Args const&... args
|
||||
)
|
||||
{
|
||||
return first != last && sizeof...(Args) + 1 < offset
|
||||
return first != last && sizeof...(Args) + 1 < static_cast<std::size_t>(offset)
|
||||
? !(head == *first)
|
||||
? unique_copy_impl_2(sprout::next(first), last, result, offset, *first, args..., head)
|
||||
: unique_copy_impl_2(sprout::next(first), last, result, offset, head, args...)
|
||||
|
@ -94,9 +95,11 @@ namespace sprout {
|
|||
Args const&... args
|
||||
)
|
||||
{
|
||||
return sizeof...(Args) < offset
|
||||
return sizeof...(Args) < static_cast<std::size_t>(offset)
|
||||
? unique_copy_impl_1(first, last, result, offset, args..., *(sprout::fixed_begin(result) + sizeof...(Args)))
|
||||
: unique_copy_impl_2(sprout::next(first), last, result, offset + sprout::size(result), *first, args...)
|
||||
: first != last
|
||||
? unique_copy_impl_2(sprout::next(first), last, result, offset + sprout::size(result), *first, args...)
|
||||
: unique_copy_impl_3(result, args...)
|
||||
;
|
||||
}
|
||||
template<typename InputIterator, typename Result>
|
||||
|
@ -137,7 +140,7 @@ namespace sprout {
|
|||
Args const&... args
|
||||
)
|
||||
{
|
||||
return sprout::remake_clone<Result, Result>(result, sprout::size(result), args...);
|
||||
return sprout::remake_clone<Result, Result>(result, sprout::size(result), args..., head);
|
||||
}
|
||||
template<typename InputIterator, typename Result, typename BinaryPredicate, typename Head, typename... Args>
|
||||
SPROUT_CONSTEXPR inline typename std::enable_if<
|
||||
|
@ -153,7 +156,7 @@ namespace sprout {
|
|||
Args const&... args
|
||||
)
|
||||
{
|
||||
return first != last && sizeof...(Args) + 1 < offset
|
||||
return first != last && sizeof...(Args) + 1 < static_cast<std::size_t>(offset)
|
||||
? !pred(head, *first)
|
||||
? unique_copy_impl_2(sprout::next(first), last, result, pred, offset, *first, args..., head)
|
||||
: unique_copy_impl_2(sprout::next(first), last, result, pred, offset, head, args...)
|
||||
|
@ -188,9 +191,11 @@ namespace sprout {
|
|||
Args const&... args
|
||||
)
|
||||
{
|
||||
return sizeof...(Args) < offset
|
||||
return sizeof...(Args) < static_cast<std::size_t>(offset)
|
||||
? unique_copy_impl_1(first, last, result, pred, offset, args..., *(sprout::fixed_begin(result) + sizeof...(Args)))
|
||||
: unique_copy_impl_2(sprout::next(first), last, result, pred, offset + sprout::size(result), *first, args...)
|
||||
: first != last
|
||||
? unique_copy_impl_2(sprout::next(first), last, result, pred, offset + sprout::size(result), *first, args...)
|
||||
: unique_copy_impl_3(result, args...)
|
||||
;
|
||||
}
|
||||
template<typename InputIterator, typename Result, typename BinaryPredicate>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue