mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-02 14:04:20 +00:00
fix iterator implementation
This commit is contained in:
parent
4c996bd47b
commit
7c706381d4
65 changed files with 494 additions and 313 deletions
|
@ -109,7 +109,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR ForwardIterator
|
||||
adjacent_find(
|
||||
ForwardIterator first, ForwardIterator last, BinaryPredicate pred,
|
||||
void*
|
||||
std::forward_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<ForwardIterator, ForwardIterator> type;
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR bool
|
||||
all_of(
|
||||
InputIterator first, InputIterator last, Predicate pred,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<InputIterator, bool> type;
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR bool
|
||||
all_of_equal(
|
||||
InputIterator first, InputIterator last, T const& value,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<InputIterator, bool> type;
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR bool
|
||||
any_of(
|
||||
InputIterator first, InputIterator last, Predicate pred,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<InputIterator, bool> type;
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR bool
|
||||
any_of_equal(
|
||||
InputIterator first, InputIterator last, T const& value,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<InputIterator, bool> type;
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR typename std::iterator_traits<InputIterator>::difference_type
|
||||
count(
|
||||
InputIterator first, InputIterator last, T const& value,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<InputIterator, typename std::iterator_traits<InputIterator>::difference_type> type;
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR typename std::iterator_traits<InputIterator>::difference_type
|
||||
count_if(
|
||||
InputIterator first, InputIterator last, Predicate pred,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<InputIterator, typename std::iterator_traits<InputIterator>::difference_type> type;
|
||||
|
|
|
@ -91,7 +91,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR bool
|
||||
equal(
|
||||
InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, BinaryPredicate pred,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::tuples::tuple<InputIterator1, InputIterator2, bool> type;
|
||||
|
|
|
@ -86,7 +86,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR InputIterator
|
||||
find(
|
||||
InputIterator first, InputIterator last, T const& value,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<InputIterator, bool> type;
|
||||
|
|
|
@ -134,7 +134,7 @@ namespace sprout {
|
|||
ForwardIterator1 first1, ForwardIterator1 last1,
|
||||
ForwardIterator2 first2, ForwardIterator2 last2,
|
||||
BinaryPredicate pred,
|
||||
void*
|
||||
std::forward_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<ForwardIterator1, ForwardIterator1> type;
|
||||
|
|
|
@ -102,7 +102,7 @@ namespace sprout {
|
|||
InputIterator1 first1, InputIterator1 last1,
|
||||
ForwardIterator2 first2, ForwardIterator2 last2,
|
||||
BinaryPredicate pred,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<InputIterator1, bool> type;
|
||||
|
|
|
@ -86,7 +86,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR InputIterator
|
||||
find_if(
|
||||
InputIterator first, InputIterator last, Predicate pred,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<InputIterator, bool> type;
|
||||
|
|
|
@ -86,7 +86,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR InputIterator
|
||||
find_if_not(
|
||||
InputIterator first, InputIterator last, Predicate pred,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<InputIterator, bool> type;
|
||||
|
|
|
@ -105,7 +105,7 @@ namespace sprout {
|
|||
typename std::iterator_traits<InputIterator>::value_type const& low,
|
||||
typename std::iterator_traits<InputIterator>::value_type const& high,
|
||||
Compare comp,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
return sprout::fixed::detail::clamp_range_copy_impl(first, last, result, low, high, comp, sprout::size(result));
|
||||
|
|
|
@ -83,7 +83,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
|
||||
copy(
|
||||
InputIterator first, InputIterator last, Result const& result,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
return sprout::fixed::detail::copy_impl(first, last, result, sprout::size(result));
|
||||
|
|
|
@ -82,7 +82,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
|
||||
copy_backward(
|
||||
BidirectionalIterator first, BidirectionalIterator last, Result const& result,
|
||||
void*
|
||||
std::bidirectional_iterator_tag*
|
||||
)
|
||||
{
|
||||
return sprout::fixed::detail::copy_backward_impl(
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
|
||||
copy_n(
|
||||
InputIterator first, Size n, Result const& result,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
return sprout::fixed::detail::copy_n_impl(first, n, result, sprout::size(result));
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
|
||||
copy_until(
|
||||
InputIterator first, InputIterator last, Result const& result, Predicate pred,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
return sprout::fixed::detail::copy_until_impl(first, last, result, pred, sprout::size(result));
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
|
||||
copy_while(
|
||||
InputIterator first, InputIterator last, Result const& result, Predicate pred,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
return sprout::fixed::detail::copy_while_impl(first, last, result, pred, sprout::size(result));
|
||||
|
|
|
@ -93,7 +93,7 @@ namespace sprout {
|
|||
replace_copy(
|
||||
InputIterator first, InputIterator last,
|
||||
Result const& result, T const& old_value, T const& new_value,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
return sprout::fixed::detail::replace_copy_impl(first, last, result, old_value, new_value, sprout::size(result));
|
||||
|
|
|
@ -92,7 +92,7 @@ namespace sprout {
|
|||
replace_copy_if(
|
||||
InputIterator first, InputIterator last,
|
||||
Result const& result, Predicate pred, T const& new_value,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
return sprout::fixed::detail::replace_copy_if_impl(first, last, result, pred, new_value, sprout::size(result));
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
|
||||
reverse_copy(
|
||||
BidirectionalIterator first, BidirectionalIterator last, Result const& result,
|
||||
void*
|
||||
std::bidirectional_iterator_tag*
|
||||
)
|
||||
{
|
||||
return sprout::fixed::detail::reverse_copy_impl(first, last, result, sprout::size(result));
|
||||
|
|
|
@ -125,7 +125,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
|
||||
rotate_copy(
|
||||
ForwardIterator first, ForwardIterator middle, ForwardIterator last, Result const& result,
|
||||
void*
|
||||
std::forward_iterator_tag*
|
||||
)
|
||||
{
|
||||
return sprout::fixed::detail::rotate_copy_impl(first, middle, last, result, sprout::size(result));
|
||||
|
|
|
@ -102,7 +102,7 @@ namespace sprout {
|
|||
ForwardIterator first, ForwardIterator last,
|
||||
Result const& result,
|
||||
ForwardIterator pos1, ForwardIterator pos2,
|
||||
void*
|
||||
std::forward_iterator_tag*
|
||||
)
|
||||
{
|
||||
return sprout::fixed::detail::swap_element_copy_impl(first, last, result, sprout::size(result));
|
||||
|
|
|
@ -90,7 +90,7 @@ namespace sprout {
|
|||
transform(
|
||||
InputIterator first, InputIterator last,
|
||||
Result const& result, UnaryOperation op,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
return sprout::fixed::detail::transform_impl(first, last, result, op, sprout::size(result));
|
||||
|
@ -207,7 +207,7 @@ namespace sprout {
|
|||
transform(
|
||||
InputIterator1 first1, InputIterator1 last1, InputIterator2 first2,
|
||||
Result const& result, BinaryOperation op,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
return sprout::fixed::detail::transform_impl(first1, last1, first2, result, op, sprout::size(result));
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace sprout {
|
|||
InputIterator1 first1, InputIterator1 last1,
|
||||
InputIterator2 first2, InputIterator2 last2,
|
||||
Compare comp,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<InputIterator1, InputIterator2> type;
|
||||
|
|
|
@ -78,7 +78,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR bool
|
||||
is_partitioned(
|
||||
InputIterator first, InputIterator last, Predicate pred,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<InputIterator, typename std::iterator_traits<InputIterator>::difference_type> type;
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR bool
|
||||
is_permutation(
|
||||
ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, BinaryPredicate pred,
|
||||
void*
|
||||
std::forward_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<ForwardIterator1, bool> type;
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR bool
|
||||
is_sorted(
|
||||
ForwardIterator first, ForwardIterator last, Compare comp,
|
||||
void*
|
||||
std::forward_iterator_tag*
|
||||
)
|
||||
{
|
||||
return sprout::is_sorted_until(first, last, comp) == last;
|
||||
|
|
|
@ -94,7 +94,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR ForwardIterator
|
||||
is_sorted_until(
|
||||
ForwardIterator first, ForwardIterator last, Compare comp,
|
||||
void*
|
||||
std::forward_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<ForwardIterator, ForwardIterator> type;
|
||||
|
|
|
@ -126,7 +126,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR bool
|
||||
lexicographical_compare(
|
||||
InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Compare comp,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<InputIterator1, InputIterator2> type;
|
||||
|
|
|
@ -97,7 +97,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR ForwardIterator
|
||||
max_element(
|
||||
ForwardIterator first, ForwardIterator last, Compare comp,
|
||||
void*
|
||||
std::forward_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<ForwardIterator, ForwardIterator> type;
|
||||
|
|
|
@ -97,7 +97,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR ForwardIterator
|
||||
min_element(
|
||||
ForwardIterator first, ForwardIterator last, Compare comp,
|
||||
void*
|
||||
std::forward_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<ForwardIterator, ForwardIterator> type;
|
||||
|
|
|
@ -109,7 +109,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR sprout::pair<ForwardIterator, ForwardIterator>
|
||||
minmax_element(
|
||||
ForwardIterator first, ForwardIterator last, Compare comp,
|
||||
void*
|
||||
std::forward_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<ForwardIterator, sprout::pair<ForwardIterator, ForwardIterator> > type;
|
||||
|
|
|
@ -112,7 +112,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR sprout::pair<InputIterator1, InputIterator2>
|
||||
mismatch(
|
||||
InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, BinaryPredicate pred,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::tuples::tuple<InputIterator1, InputIterator2, bool> type;
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR bool
|
||||
none_of(
|
||||
InputIterator first, InputIterator last, Predicate pred,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<InputIterator, bool> type;
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR bool
|
||||
none_of_equal(
|
||||
InputIterator first, InputIterator last, T const& value,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<InputIterator, bool> type;
|
||||
|
|
|
@ -108,7 +108,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR bool
|
||||
one_of(
|
||||
InputIterator first, InputIterator last, Predicate pred,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<InputIterator, typename std::iterator_traits<InputIterator>::difference_type> type;
|
||||
|
|
|
@ -108,7 +108,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR bool
|
||||
one_of_equal(
|
||||
InputIterator first, InputIterator last, T const& value,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<InputIterator, typename std::iterator_traits<InputIterator>::difference_type> type;
|
||||
|
|
|
@ -110,7 +110,7 @@ namespace sprout {
|
|||
ForwardIterator1 first1, ForwardIterator1 last1,
|
||||
ForwardIterator2 first2, ForwardIterator2 last2,
|
||||
BinaryPredicate pred,
|
||||
void*
|
||||
std::forward_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<ForwardIterator1, bool> type;
|
||||
|
|
|
@ -18,9 +18,10 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR ForwardIterator
|
||||
search_n(ForwardIterator first, ForwardIterator last, Size count, T const& value, BinaryPredicate pred) {
|
||||
typedef sprout::value_iterator<T const&> iterator;
|
||||
typedef typename std::iterator_traits<iterator>::difference_type difference_type;
|
||||
return sprout::search(
|
||||
first, last,
|
||||
iterator(value, static_cast<typename std::iterator_traits<iterator>::difference_type>(count)), iterator(value, 0),
|
||||
iterator(value, static_cast<difference_type>(count)), iterator(value, 0),
|
||||
pred
|
||||
);
|
||||
}
|
||||
|
|
|
@ -129,7 +129,7 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR int
|
||||
tristate_lexicographical_compare(
|
||||
InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Compare comp,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<InputIterator1, InputIterator2> type;
|
||||
|
@ -298,7 +298,7 @@ namespace sprout {
|
|||
InputIterator1 first1, InputIterator1 last1, T1 const& delim1,
|
||||
InputIterator2 first2, InputIterator2 last2, T2 const& delim2,
|
||||
Compare comp,
|
||||
void*
|
||||
std::input_iterator_tag*
|
||||
)
|
||||
{
|
||||
typedef sprout::pair<InputIterator1, InputIterator2> type;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue