porting sscrisk/CEL

This commit is contained in:
bolero-MURAKAMI 2012-04-01 22:15:09 +09:00
parent ad60c8c530
commit db20f64991
181 changed files with 2531 additions and 607 deletions

View file

@ -2,7 +2,7 @@
#define SPROUT_ALGORITHM_HPP
#include <sprout/config.hpp>
#include <sprout/algorithm/fixed.hpp>
#include <sprout/algorithm/fit.hpp>
#include <sprout/algorithm/non_modifying.hpp>
#include <sprout/algorithm/modifying.hpp>
#endif // #ifndef SPROUT_ALGORITHM_HPP

View file

@ -0,0 +1,31 @@
#ifndef SPROUT_ALGORITHM_ADJACENT_FIND_HPP
#define SPROUT_ALGORITHM_ADJACENT_FIND_HPP
#include <iterator>
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.2.8 Adjacent find
template<typename ForwardIterator, typename BinaryPredicate>
SPROUT_CONSTEXPR ForwardIterator adjacent_find(ForwardIterator first, ForwardIterator last, BinaryPredicate pred) {
return first == last || sprout::next(first) == last ? last
: pred(*first, *(sprout::next(first))) != false ? first
: sprout::adjacent_find(sprout::next(first), last, pred)
;
}
template<typename ForwardIterator>
SPROUT_CONSTEXPR ForwardIterator adjacent_find(ForwardIterator first, ForwardIterator last) {
return sprout::adjacent_find(
first,
last,
NS_SSCRISK_CEL_OR_SPROUT::equal_to<typename std::iterator_traits<ForwardIterator>::value_type>()
);
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_ADJACENT_FIND_HPP

View file

@ -0,0 +1,19 @@
#ifndef SPROUT_ALGORITHM_ALL_OF_HPP
#define SPROUT_ALGORITHM_ALL_OF_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.2.1 All of
template<typename InputIterator, typename Predicate>
SPROUT_CONSTEXPR bool all_of(InputIterator first, InputIterator last, Predicate pred) {
return first == last ? true
: pred(*first) == true && sprout::all_of(sprout::next(first), last, pred)
;
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_ALL_OF_HPP

View file

@ -0,0 +1,19 @@
#ifndef SPROUT_ALGORITHM_ANY_OF_HPP
#define SPROUT_ALGORITHM_ANY_OF_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.2.2 Any of
template<typename InputIterator, typename Predicate>
SPROUT_CONSTEXPR bool any_of(InputIterator first, InputIterator last, Predicate pred) {
return first == last ? false
: pred(*first) == true || sprout::any_of(sprout::next(first), last, pred)
;
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_ANY_OF_HPP

View file

@ -0,0 +1,37 @@
#ifndef SPROUT_ALGORITHM_BINARY_SEARCH_HPP
#define SPROUT_ALGORITHM_BINARY_SEARCH_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.4.3.4 binary_search
template<typename ForwardIterator, typename T>
SPROUT_CONSTEXPR bool binary_search(ForwardIterator first, ForwardIterator last, T const& value) {
return first == last ? false
: sprout::next(first) == last ? !(*first < value) && !(value < *first) ? true : false
: *(first + NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) / 2) < value
? sprout::binary_search(first + NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) / 2, last, value)
: value < *(first + NS_SSCRISK_CEL_OR_SPROUT::distance(first, last)) / 2
? sprout::binary_search(first, first + NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) / 2, value)
: true
;
}
template<typename ForwardIterator, typename T, typename Compare>
SPROUT_CONSTEXPR bool binary_search(ForwardIterator first, ForwardIterator last, T const& value, Compare comp) {
return first == last ? false
: sprout::next(first) == last ? !comp(*first, value) && !comp(value, *first) ? true : false
: comp(*(first + NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) / 2), value)
? sprout::binary_search(first + NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) / 2, last, value)
: comp(value, *(first + NS_SSCRISK_CEL_OR_SPROUT::distance(first, last)) / 2)
? sprout::binary_search(first, first + NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) / 2, value)
: true
;
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_BINARY_SEARCH_HPP

View file

@ -0,0 +1,21 @@
#ifndef SPROUT_ALGORITHM_COUNT_HPP
#define SPROUT_ALGORITHM_COUNT_HPP
#include <iterator>
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.2.9 Count
template<typename InputIterator, typename T>
SPROUT_CONSTEXPR typename std::iterator_traits<InputIterator>::difference_type
count(InputIterator first, InputIterator last, T const& value) {
return first == last ? 0
: (*first == value ? 1 : 0) + sprout::count(sprout::next(first), last, value)
;
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_COUNT_HPP

View file

@ -0,0 +1,21 @@
#ifndef SPROUT_ALGORITHM_COUNT_IF_HPP
#define SPROUT_ALGORITHM_COUNT_IF_HPP
#include <iterator>
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.2.9 Count
template<typename InputIterator, typename Predicate>
SPROUT_CONSTEXPR typename std::iterator_traits<InputIterator>::difference_type
count_if(InputIterator first, InputIterator last, Predicate pred) {
return first == last ? 0
: (pred(*first) != false ? 1 : 0) + sprout::count_if(sprout::next(first), last, pred)
;
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_COUNT_IF_HPP

View file

@ -0,0 +1,37 @@
#ifndef SPROUT_ALGORITHM_EQUAL_HPP
#define SPROUT_ALGORITHM_EQUAL_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.2.11 Equal
template<typename InputIterator1, typename InputIterator2>
SPROUT_CONSTEXPR bool equal(
InputIterator1 first1,
InputIterator1 last1,
InputIterator2 first2
)
{
return first1 == last1 ? true
: *first1 == *first2 && sprout::equal(sprout::next(first1), last1, sprout::next(first2))
;
}
template<typename InputIterator1, typename InputIterator2, typename BinaryPredicate>
SPROUT_CONSTEXPR bool equal(
InputIterator1 first1,
InputIterator1 last1,
InputIterator2 first2,
BinaryPredicate pred
)
{
return first1 == last1 ? true
: pred(*first1, *first2) != false && sprout::equal(sprout::next(first1), last1, sprout::next(first2), pred)
;
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_EQUAL_HPP

View file

@ -0,0 +1,35 @@
#ifndef SPROUT_ALGORITHM_EQUAL_RANGE_HPP
#define SPROUT_ALGORITHM_EQUAL_RANGE_HPP
#include <sprout/config.hpp>
#include <sprout/algorithm/lower_bound.hpp>
#include <sprout/algorithm/upper_bound.hpp>
#include <sprout/utility/pair.hpp>
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.4.3.3 equal_range
template<typename ForwardIterator, typename T>
SPROUT_CONSTEXPR sprout::pair<ForwardIterator, ForwardIterator> equal_range(
ForwardIterator first,
ForwardIterator last,
T const& value
)
{
return {sprout::lower_bound(first, last, value), sprout::upper_bound(first, last, value)};
}
template<typename ForwardIterator, typename T, typename Compare>
SPROUT_CONSTEXPR pair<ForwardIterator, ForwardIterator> equal_range(
ForwardIterator first,
ForwardIterator last,
T const& value,
Compare comp
)
{
return {sprout::lower_bound(first, last, value, comp), sprout::upper_bound(first, last, value, comp)};
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_EQUAL_RANGE_HPP

19
sprout/algorithm/find.hpp Normal file
View file

@ -0,0 +1,19 @@
#ifndef SPROUT_ALGORITHM_FIND_HPP
#define SPROUT_ALGORITHM_FIND_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.2.5 Find
template<typename InputIterator, typename T>
SPROUT_CONSTEXPR InputIterator find(InputIterator first, InputIterator last, T const& value) {
return first == last || *first == value ? first
: sprout::find(sprout::next(first), last, value)
;
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_FIND_HPP

View file

@ -0,0 +1,61 @@
#ifndef SPROUT_ALGORITHM_FIND_END_HPP
#define SPROUT_ALGORITHM_FIND_END_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/search.hpp>
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
namespace detail {
template<typename Iterator1, typename Iterator2>
struct iter_equal_to {
public:
SPROUT_CONSTEXPR bool operator()(
typename std::iterator_traits<Iterator1>::value_type const& x,
typename std::iterator_traits<Iterator2>::value_type const& y
) const
{
return x == y;
}
};
} // namespace detail
// 25.2.6 Find end
template<typename ForwardIterator1, typename ForwardIterator2, typename BinaryPredicate>
SPROUT_CONSTEXPR ForwardIterator1 find_end(
ForwardIterator1 first1,
ForwardIterator1 last1,
ForwardIterator2 first2,
ForwardIterator2 last2,
BinaryPredicate pred
)
{
return first1 == last1 || first2 == last2 ? last1
: sprout::search(first1, last1, first2, last2, pred) == first1
&& sprout::search(sprout::next(first1), last1, first2, last2, pred) == last1
? first1
: sprout::find_end(sprout::next(first1), last1, first2, last2, pred)
;
}
template<typename ForwardIterator1, typename ForwardIterator2>
SPROUT_CONSTEXPR ForwardIterator1 find_end(
ForwardIterator1 first1,
ForwardIterator1 last1,
ForwardIterator2 first2,
ForwardIterator2 last2
)
{
return sprout::find_end(
first1,
last1,
first2,
last2,
sprout::detail::iter_equal_to<ForwardIterator1, ForwardIterator2>()
);
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_FIND_END_HPP

View file

@ -0,0 +1,40 @@
#ifndef SPROUT_ALGORITHM_FIND_FIRST_OF_HPP
#define SPROUT_ALGORITHM_FIND_FIRST_OF_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.2.7 Find first
template<typename ForwardIterator1, typename ForwardIterator2, typename BinaryPredicate>
SPROUT_CONSTEXPR ForwardIterator1 find_first_of(
ForwardIterator1 first1,
ForwardIterator1 last1,
ForwardIterator2 first2,
ForwardIterator2 last2,
BinaryPredicate pred
)
{
return first1 == last1 || sprout::find_if(first2, last2, NS_SSCRISK_CEL_OR_SPROUT::bind2nd(pred, *first1)) != last2 ? first1
: sprout::find_first_of(sprout::next(first1), last1, first2, last2, pred)
;
}
template<typename ForwardIterator1, typename ForwardIterator2>
SPROUT_CONSTEXPR ForwardIterator1 find_first_of(
ForwardIterator1 first1,
ForwardIterator1 last1,
ForwardIterator2 first2,
ForwardIterator2 last2
)
{
return first1 == last1 || sprout::find(first2, last2, *first1) != last2 ? first1
: sprout::find_first_of(sprout::next(first1), last1, first2, last2)
;
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_FIND_FIRST_OF_HPP

View file

@ -0,0 +1,19 @@
#ifndef SPROUT_ALGORITHM_FIND_IF_HPP
#define SPROUT_ALGORITHM_FIND_IF_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.2.5 Find
template<typename InputIterator, typename Predicate>
SPROUT_CONSTEXPR InputIterator find_if(InputIterator first, InputIterator last, Predicate pred) {
return first == last || pred(*first) != false ? first
: sprout::find_if(sprout::next(first), last, pred)
;
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_FIND_IF_HPP

View file

@ -0,0 +1,20 @@
#ifndef SPROUT_ALGORITHM_FIND_IF_NOT_HPP
#define SPROUT_ALGORITHM_FIND_IF_NOT_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.2.5 Find
template<typename InputIterator, typename Predicate>
SPROUT_CONSTEXPR InputIterator find_if_not(InputIterator first, InputIterator last, Predicate pred)
{
return first == last || pred(*first) == false ? first
: sprout::find_if_not(sprout::next(first), last, pred)
;
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_FIND_IF_NOT_HPP

View file

@ -7,8 +7,8 @@
#include <sprout/algorithm/fixed/copy.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -24,7 +24,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::copy(first, last, result)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, last), sprout::size(result))
offset + NS_SSCRISK_CEL_OR_SPROUT::min(NS_SSCRISK_CEL_OR_SPROUT::distance(first, last), sprout::size(result))
);
}
} // namespace detail

View file

@ -7,8 +7,8 @@
#include <sprout/algorithm/fixed/copy_backward.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -23,7 +23,7 @@ namespace sprout {
{
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::copy_backward(first, last, result)),
offset - NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, last), sprout::size(result)),
offset - NS_SSCRISK_CEL_OR_SPROUT::min(NS_SSCRISK_CEL_OR_SPROUT::distance(first, last), sprout::size(result)),
offset
);
}

View file

@ -7,7 +7,7 @@
#include <sprout/algorithm/fixed/copy_if.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -24,7 +24,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::copy_if(first, last, result, pred)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(NS_SSCRISK_CEL_OR_SPROUT_DETAIL::count_if(first, last, pred), sprout::size(result))
offset + NS_SSCRISK_CEL_OR_SPROUT::min(NS_SSCRISK_CEL_OR_SPROUT::count_if(first, last, pred), sprout::size(result))
);
}
} // namespace detail

View file

@ -7,7 +7,7 @@
#include <sprout/algorithm/fixed/copy_n.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -23,7 +23,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::copy_n(first, n, result)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(n, sprout::size(result))
offset + NS_SSCRISK_CEL_OR_SPROUT::min(n, sprout::size(result))
);
}
} // namespace detail

View file

@ -7,7 +7,7 @@
#include <sprout/algorithm/fixed/fill_n.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -23,7 +23,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::fill_n(cont, n, value)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(n, sprout::size(cont))
offset + NS_SSCRISK_CEL_OR_SPROUT::min(n, sprout::size(cont))
);
}
} // namespace detail

View file

@ -7,7 +7,7 @@
#include <sprout/algorithm/fixed/generate_n.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -24,7 +24,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::generate_n(cont, n, gen, inits...)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(n, sprout::size(cont))
offset + NS_SSCRISK_CEL_OR_SPROUT::min(n, sprout::size(cont))
);
}
} // namespace detail

View file

@ -7,7 +7,7 @@
#include <sprout/algorithm/fixed/make_partial_heap.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -23,7 +23,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::make_partial_heap(cont, middle, comp)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(sprout::begin(cont), middle)
offset + NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::begin(cont), middle)
);
}
} // namespace detail
@ -51,7 +51,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::make_partial_heap(cont, middle)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(sprout::begin(cont), middle)
offset + NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::begin(cont), middle)
);
}
} // namespace detail

View file

@ -7,8 +7,8 @@
#include <sprout/algorithm/fixed/merge.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -27,8 +27,8 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::merge(first1, last1, first2, last2, result, comp)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first1, last1) + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first2, last2),
offset + NS_SSCRISK_CEL_OR_SPROUT::min(
NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1) + NS_SSCRISK_CEL_OR_SPROUT::distance(first2, last2),
sprout::size(result)
)
);
@ -64,8 +64,8 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::merge(first1, last1, first2, last2, result)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first1, last1) + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first2, last2),
offset + NS_SSCRISK_CEL_OR_SPROUT::min(
NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1) + NS_SSCRISK_CEL_OR_SPROUT::distance(first2, last2),
sprout::size(result)
)
);

View file

@ -7,7 +7,7 @@
#include <sprout/algorithm/fixed/nth_element.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -23,7 +23,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::nth_element(cont, nth, comp)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(sprout::begin(cont), nth) + 1
offset + NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::begin(cont), nth) + 1
);
}
} // namespace detail
@ -51,7 +51,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::nth_element(cont, nth)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(sprout::begin(cont), nth) + 1
offset + NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::begin(cont), nth) + 1
);
}
} // namespace detail

View file

@ -7,7 +7,7 @@
#include <sprout/algorithm/fixed/partial_sort.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -23,7 +23,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::partial_sort(cont, middle, comp)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(sprout::begin(cont), middle)
offset + NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::begin(cont), middle)
);
}
} // namespace detail
@ -51,7 +51,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::partial_sort(cont, middle)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(sprout::begin(cont), middle)
offset + NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::begin(cont), middle)
);
}
} // namespace detail

View file

@ -7,7 +7,7 @@
#include <sprout/algorithm/fixed/partition.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -22,7 +22,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::partition(cont, pred)),
offset,
offset + sprout::size(cont) - NS_SSCRISK_CEL_OR_SPROUT_DETAIL::count_if(sprout::begin(cont), sprout::end(cont), pred)
offset + sprout::size(cont) - NS_SSCRISK_CEL_OR_SPROUT::count_if(sprout::begin(cont), sprout::end(cont), pred)
);
}
} // namespace detail

View file

@ -8,8 +8,8 @@
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include <sprout/detail/algorithm_ext.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -28,8 +28,8 @@ namespace sprout {
offset,
offset + sprout::detail::count_n_if(
first,
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, last),
NS_SSCRISK_CEL_OR_SPROUT::min(
NS_SSCRISK_CEL_OR_SPROUT::distance(first, last),
sprout::size(result)
),
pred

View file

@ -7,7 +7,7 @@
#include <sprout/algorithm/fixed/remove.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -22,7 +22,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::remove(cont, value)),
offset,
offset + sprout::size(cont) - NS_SSCRISK_CEL_OR_SPROUT_DETAIL::count(sprout::begin(cont), sprout::end(cont), value)
offset + sprout::size(cont) - NS_SSCRISK_CEL_OR_SPROUT::count(sprout::begin(cont), sprout::end(cont), value)
);
}
} // namespace detail

View file

@ -7,8 +7,8 @@
#include <sprout/algorithm/fixed/remove_copy.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -25,7 +25,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::remove_copy(first, last, result, value)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, last) - NS_SSCRISK_CEL_OR_SPROUT_DETAIL::count(first, last, value), sprout::size(result))
offset + NS_SSCRISK_CEL_OR_SPROUT::min(NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) - NS_SSCRISK_CEL_OR_SPROUT::count(first, last, value), sprout::size(result))
);
}
} // namespace detail

View file

@ -7,8 +7,8 @@
#include <sprout/algorithm/fixed/remove_copy_if.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -25,7 +25,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::remove_copy_if(first, last, result, pred)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, last) - NS_SSCRISK_CEL_OR_SPROUT_DETAIL::count_if(first, last, pred), sprout::size(result))
offset + NS_SSCRISK_CEL_OR_SPROUT::min(NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) - NS_SSCRISK_CEL_OR_SPROUT::count_if(first, last, pred), sprout::size(result))
);
}
} // namespace detail

View file

@ -7,7 +7,7 @@
#include <sprout/algorithm/fixed/remove_if.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -22,7 +22,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::remove_if(cont, pred)),
offset,
offset + sprout::size(cont) - NS_SSCRISK_CEL_OR_SPROUT_DETAIL::count_if(sprout::begin(cont), sprout::end(cont), pred)
offset + sprout::size(cont) - NS_SSCRISK_CEL_OR_SPROUT::count_if(sprout::begin(cont), sprout::end(cont), pred)
);
}
} // namespace detail

View file

@ -7,8 +7,8 @@
#include <sprout/algorithm/fixed/replace_copy.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -26,7 +26,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::replace_copy(first, last, result, old_value, new_value)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, last), sprout::size(result))
offset + NS_SSCRISK_CEL_OR_SPROUT::min(NS_SSCRISK_CEL_OR_SPROUT::distance(first, last), sprout::size(result))
);
}
} // namespace detail

View file

@ -7,8 +7,8 @@
#include <sprout/algorithm/fixed/replace_copy_if.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -26,7 +26,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::replace_copy_if(first, last, result, pred, new_value)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, last), sprout::size(result))
offset + NS_SSCRISK_CEL_OR_SPROUT::min(NS_SSCRISK_CEL_OR_SPROUT::distance(first, last), sprout::size(result))
);
}
} // namespace detail

View file

@ -7,8 +7,8 @@
#include <sprout/algorithm/fixed/reverse_copy.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -24,7 +24,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::reverse_copy(first, last, result)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, last), sprout::size(result))
offset + NS_SSCRISK_CEL_OR_SPROUT::min(NS_SSCRISK_CEL_OR_SPROUT::distance(first, last), sprout::size(result))
);
}
} // namespace detail

View file

@ -7,8 +7,8 @@
#include <sprout/algorithm/fixed/rotate_copy.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -25,7 +25,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::rotate_copy(first, middle, last, result)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, last), sprout::size(result))
offset + NS_SSCRISK_CEL_OR_SPROUT::min(NS_SSCRISK_CEL_OR_SPROUT::distance(first, last), sprout::size(result))
);
}
} // namespace detail

View file

@ -8,8 +8,8 @@
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include <sprout/detail/overlap_count_2.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -28,8 +28,8 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::set_difference(first1, last1, first2, last2, result, comp)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first1, last1)
offset + NS_SSCRISK_CEL_OR_SPROUT::min(
NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1)
- sprout::detail::overlap_count_2(first1, last1, first2, last2, comp)
,
sprout::size(result)
@ -67,8 +67,8 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::set_difference(first1, last1, first2, last2, result)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first1, last1)
offset + NS_SSCRISK_CEL_OR_SPROUT::min(
NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1)
- sprout::detail::overlap_count_2(first1, last1, first2, last2)
,
sprout::size(result)

View file

@ -8,7 +8,7 @@
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include <sprout/detail/overlap_count_2.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -27,7 +27,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::set_intersection(first1, last1, first2, last2, result, comp)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(
offset + NS_SSCRISK_CEL_OR_SPROUT::min(
sprout::detail::overlap_count_2(first1, last1, first2, last2, comp),
sprout::size(result)
)
@ -64,7 +64,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::set_intersection(first1, last1, first2, last2, result)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(
offset + NS_SSCRISK_CEL_OR_SPROUT::min(
sprout::detail::overlap_count_2(first1, last1, first2, last2),
sprout::size(result)
)

View file

@ -8,8 +8,8 @@
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include <sprout/detail/overlap_count_2.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -28,9 +28,9 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::set_symmetric_difference(first1, last1, first2, last2, result, comp)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first1, last1)
+ NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first2, last2)
offset + NS_SSCRISK_CEL_OR_SPROUT::min(
NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1)
+ NS_SSCRISK_CEL_OR_SPROUT::distance(first2, last2)
- 2 * sprout::detail::overlap_count_2(first1, last1, first2, last2, comp)
,
sprout::size(result)
@ -68,9 +68,9 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::set_symmetric_difference(first1, last1, first2, last2, result)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first1, last1)
+ NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first2, last2)
offset + NS_SSCRISK_CEL_OR_SPROUT::min(
NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1)
+ NS_SSCRISK_CEL_OR_SPROUT::distance(first2, last2)
- 2 * sprout::detail::overlap_count_2(first1, last1, first2, last2)
,
sprout::size(result)

View file

@ -8,8 +8,8 @@
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include <sprout/detail/overlap_count_2.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -28,9 +28,9 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::set_union(first1, last1, first2, last2, result, comp)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first1, last1)
+ NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first2, last2)
offset + NS_SSCRISK_CEL_OR_SPROUT::min(
NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1)
+ NS_SSCRISK_CEL_OR_SPROUT::distance(first2, last2)
- sprout::detail::overlap_count_2(first1, last1, first2, last2, comp)
,
sprout::size(result)
@ -68,9 +68,9 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::set_union(first1, last1, first2, last2, result)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first1, last1)
+ NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first2, last2)
offset + NS_SSCRISK_CEL_OR_SPROUT::min(
NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1)
+ NS_SSCRISK_CEL_OR_SPROUT::distance(first2, last2)
- sprout::detail::overlap_count_2(first1, last1, first2, last2)
,
sprout::size(result)

View file

@ -7,7 +7,7 @@
#include <sprout/algorithm/fixed/stable_partition.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -22,7 +22,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::stable_partition(cont, pred)),
offset,
offset + sprout::size(cont) - NS_SSCRISK_CEL_OR_SPROUT_DETAIL::count_if(sprout::begin(cont), sprout::end(cont), pred)
offset + sprout::size(cont) - NS_SSCRISK_CEL_OR_SPROUT::count_if(sprout::begin(cont), sprout::end(cont), pred)
);
}
} // namespace detail

View file

@ -7,7 +7,7 @@
#include <sprout/algorithm/fixed/stable_partition_copy.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -24,7 +24,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::stable_partition_copy(first, last, result, pred)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(NS_SSCRISK_CEL_OR_SPROUT_DETAIL::count_if(first, last, pred), sprout::size(result))
offset + NS_SSCRISK_CEL_OR_SPROUT::min(NS_SSCRISK_CEL_OR_SPROUT::count_if(first, last, pred), sprout::size(result))
);
}
} // namespace detail

View file

@ -7,8 +7,8 @@
#include <sprout/algorithm/fixed/swap_element_copy.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -26,7 +26,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::swap_element_copy(first, last, result, pos1, pos2)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, last), sprout::size(result))
offset + NS_SSCRISK_CEL_OR_SPROUT::min(NS_SSCRISK_CEL_OR_SPROUT::distance(first, last), sprout::size(result))
);
}
} // namespace detail

View file

@ -7,8 +7,8 @@
#include <sprout/algorithm/fixed/transform.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -25,7 +25,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::transform(first, last, result, op)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, last), sprout::size(result))
offset + NS_SSCRISK_CEL_OR_SPROUT::min(NS_SSCRISK_CEL_OR_SPROUT::distance(first, last), sprout::size(result))
);
}
} // namespace detail
@ -57,7 +57,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::transform(first1, last1, first2, result, op)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first1, last1), sprout::size(result))
offset + NS_SSCRISK_CEL_OR_SPROUT::min(NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1), sprout::size(result))
);
}
} // namespace detail

View file

@ -8,8 +8,8 @@
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp>
#include <sprout/detail/overlap_count.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fit {
@ -25,7 +25,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::unique_copy(first, last, result)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, last) - sprout::detail::overlap_count(first, last), sprout::size(result))
offset + NS_SSCRISK_CEL_OR_SPROUT::min(NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) - sprout::detail::overlap_count(first, last), sprout::size(result))
);
}
} // namespace detail
@ -55,7 +55,7 @@ namespace sprout {
return sprout::sub_copy(
sprout::get_internal(sprout::fixed::unique_copy(first, last, result, pred)),
offset,
offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::min(NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, last) - sprout::detail::overlap_count(first, last, pred), sprout::size(result))
offset + NS_SSCRISK_CEL_OR_SPROUT::min(NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) - sprout::detail::overlap_count(first, last, pred), sprout::size(result))
);
}
} // namespace detail

View file

@ -9,8 +9,8 @@
#include <sprout/utility/forward.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/algorithm/fixed/shuffle.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -21,7 +21,7 @@ namespace sprout {
Compare comp
)
{
return NS_SSCRISK_CEL_OR_SPROUT_DETAIL::is_sorted(
return NS_SSCRISK_CEL_OR_SPROUT::is_sorted(
sprout::begin(sprout::tuples::get<0>(shuffled)),
sprout::end(sprout::tuples::get<0>(shuffled)),
comp
@ -43,7 +43,7 @@ namespace sprout {
Compare comp
)
{
return NS_SSCRISK_CEL_OR_SPROUT_DETAIL::is_sorted(
return NS_SSCRISK_CEL_OR_SPROUT::is_sorted(
sprout::begin(cont),
sprout::end(cont),
comp
@ -87,7 +87,7 @@ namespace sprout {
return sprout::fixed::detail::bogo_sort_impl(
cont,
sprout::forward<UniformRandomNumberGenerator>(g),
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less<typename sprout::container_traits<Container>::value_type>()
NS_SSCRISK_CEL_OR_SPROUT::less<typename sprout::container_traits<Container>::value_type>()
);
}
} // namespace fixed

View file

@ -10,8 +10,8 @@
#include <sprout/utility/forward.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/algorithm/fixed/shuffle.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -25,7 +25,7 @@ namespace sprout {
Compare comp
)
{
return NS_SSCRISK_CEL_OR_SPROUT_DETAIL::is_sorted(
return NS_SSCRISK_CEL_OR_SPROUT::is_sorted(
sprout::begin(sprout::tuples::get<0>(shuffled)),
sprout::end(sprout::tuples::get<0>(shuffled)),
comp
@ -54,7 +54,7 @@ namespace sprout {
typename sprout::fixed::result_of::algorithm<Container>::type,
typename std::decay<UniformRandomNumberGenerator>::type
> result_type;
return NS_SSCRISK_CEL_OR_SPROUT_DETAIL::is_sorted(
return NS_SSCRISK_CEL_OR_SPROUT::is_sorted(
sprout::begin(cont),
sprout::end(cont),
comp
@ -107,7 +107,7 @@ namespace sprout {
return sprout::fixed::detail::bogo_sort_result_impl(
cont,
sprout::forward<UniformRandomNumberGenerator>(g),
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less<typename sprout::container_traits<Container>::value_type>()
NS_SSCRISK_CEL_OR_SPROUT::less<typename sprout::container_traits<Container>::value_type>()
);
}
} // namespace fixed

View file

@ -10,7 +10,7 @@
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/detail/container_complate.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -50,7 +50,7 @@ namespace sprout {
typename sprout::index_range<0, sprout::container_traits<Result>::static_size>::type(),
sprout::internal_begin_offset(result),
sprout::size(result),
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, last)
NS_SSCRISK_CEL_OR_SPROUT::distance(first, last)
);
}
template<typename InputIterator, typename Result, typename... Args>

View file

@ -11,7 +11,7 @@
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/detail/container_complate_backward.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -51,7 +51,7 @@ namespace sprout {
typename sprout::index_range<0, sprout::container_traits<Result>::static_size>::type(),
sprout::internal_end_offset(result),
sprout::size(result),
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, last)
NS_SSCRISK_CEL_OR_SPROUT::distance(first, last)
);
}
template<typename BidirectionalIterator, typename Result, typename... Args>

View file

@ -7,7 +7,7 @@
#include <sprout/algorithm/fixed/swap_element.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -133,7 +133,7 @@ namespace sprout {
{
return sprout::fixed::detail::make_heap_impl(
cont,
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less<typename sprout::container_traits<Container>::value_type>(),
NS_SSCRISK_CEL_OR_SPROUT::less<typename sprout::container_traits<Container>::value_type>(),
sprout::internal_begin_offset(cont),
sprout::size(cont)
);

View file

@ -9,8 +9,8 @@
#include <sprout/algorithm/fixed/swap_element.hpp>
#include <sprout/algorithm/fixed/pop_heap.hpp>
#include <sprout/algorithm/fixed/make_heap.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -82,7 +82,7 @@ namespace sprout {
comp,
sprout::internal_begin_offset(cont),
sprout::size(cont),
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(sprout::begin(cont), middle)
NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::begin(cont), middle)
);
}
//
@ -96,10 +96,10 @@ namespace sprout {
{
return sprout::fixed::detail::make_partial_heap_impl(
cont,
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less<typename sprout::container_traits<Container>::value_type>(),
NS_SSCRISK_CEL_OR_SPROUT::less<typename sprout::container_traits<Container>::value_type>(),
sprout::internal_begin_offset(cont),
sprout::size(cont),
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(sprout::begin(cont), middle)
NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::begin(cont), middle)
);
}
} // namespace fixed

View file

@ -8,7 +8,7 @@
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/detail/container_complate.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -100,7 +100,7 @@ namespace sprout {
first2,
last2,
result,
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less<typename sprout::container_traits<Result>::value_type>(),
NS_SSCRISK_CEL_OR_SPROUT::less<typename sprout::container_traits<Result>::value_type>(),
sprout::size(result)
);
}

View file

@ -8,8 +8,8 @@
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/algorithm/fixed/swap_element.hpp>
#include <sprout/algorithm/fixed/make_partial_heap.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -58,7 +58,7 @@ namespace sprout {
comp,
sprout::internal_begin_offset(cont),
sprout::size(cont),
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(sprout::begin(cont), nth)
NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::begin(cont), nth)
);
}
//
@ -72,10 +72,10 @@ namespace sprout {
{
return sprout::fixed::detail::nth_element_impl(
cont,
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less<typename sprout::container_traits<Container>::value_type>(),
NS_SSCRISK_CEL_OR_SPROUT::less<typename sprout::container_traits<Container>::value_type>(),
sprout::internal_begin_offset(cont),
sprout::size(cont),
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(sprout::begin(cont), nth)
NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::begin(cont), nth)
);
}
} // namespace fixed

View file

@ -7,8 +7,8 @@
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/algorithm/fixed/make_partial_heap.hpp>
#include <sprout/algorithm/fixed/sort_heap.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -45,7 +45,7 @@ namespace sprout {
comp,
sprout::internal_begin_offset(cont),
sprout::size(cont),
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(sprout::begin(cont), middle)
NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::begin(cont), middle)
);
}
//
@ -59,10 +59,10 @@ namespace sprout {
{
return sprout::fixed::detail::partial_sort_impl(
cont,
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less<typename sprout::container_traits<Container>::value_type>(),
NS_SSCRISK_CEL_OR_SPROUT::less<typename sprout::container_traits<Container>::value_type>(),
sprout::internal_begin_offset(cont),
sprout::size(cont),
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(sprout::begin(cont), middle)
NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::begin(cont), middle)
);
}
} // namespace fixed

View file

@ -7,7 +7,7 @@
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/algorithm/fixed/swap_element.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -85,7 +85,7 @@ namespace sprout {
{
return sprout::fixed::detail::pop_heap_impl(
sprout::fixed::swap_element(cont, sprout::begin(cont), sprout::end(cont) - 1),
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less<typename sprout::container_traits<Container>::value_type>(),
NS_SSCRISK_CEL_OR_SPROUT::less<typename sprout::container_traits<Container>::value_type>(),
sprout::internal_begin_offset(cont),
sprout::size(cont) - 1
);

View file

@ -7,7 +7,7 @@
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/algorithm/fixed/swap_element.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -61,7 +61,7 @@ namespace sprout {
{
return sprout::fixed::detail::push_heap_impl(
cont,
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less<typename sprout::container_traits<Container>::value_type>(),
NS_SSCRISK_CEL_OR_SPROUT::less<typename sprout::container_traits<Container>::value_type>(),
sprout::internal_begin_offset(cont),
sprout::size(cont) - 1
);

View file

@ -10,8 +10,8 @@
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/detail/container_complate.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -33,7 +33,7 @@ namespace sprout {
result,
sprout::size(result),
(Indexes >= offset && Indexes < offset + size && Indexes < offset + input_size
? NS_SSCRISK_CEL_OR_SPROUT_DETAIL::equal_to<T>()(*sprout::next(first, Indexes - offset), old_value) ? new_value : *sprout::next(first, Indexes - offset)
? NS_SSCRISK_CEL_OR_SPROUT::equal_to<T>()(*sprout::next(first, Indexes - offset), old_value) ? new_value : *sprout::next(first, Indexes - offset)
: *sprout::next(sprout::internal_begin(result), Indexes)
)...
);
@ -57,7 +57,7 @@ namespace sprout {
typename sprout::index_range<0, sprout::container_traits<Result>::static_size>::type(),
sprout::internal_begin_offset(result),
sprout::size(result),
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, last)
NS_SSCRISK_CEL_OR_SPROUT::distance(first, last)
);
}
template<typename InputIterator, typename Result, typename T, typename... Args>

View file

@ -10,7 +10,7 @@
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/detail/container_complate.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -56,7 +56,7 @@ namespace sprout {
typename sprout::index_range<0, sprout::container_traits<Result>::static_size>::type(),
sprout::internal_begin_offset(result),
sprout::size(result),
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, last)
NS_SSCRISK_CEL_OR_SPROUT::distance(first, last)
);
}
template<typename InputIterator, typename Result, typename T, typename Predicate, typename... Args>

View file

@ -10,7 +10,7 @@
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/detail/container_complate.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -50,7 +50,7 @@ namespace sprout {
typename sprout::index_range<0, sprout::container_traits<Result>::static_size>::type(),
sprout::internal_begin_offset(result),
sprout::size(result),
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, last)
NS_SSCRISK_CEL_OR_SPROUT::distance(first, last)
);
}
template<typename BidirectionalIterator, typename Result, typename... Args>

View file

@ -10,7 +10,7 @@
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/detail/container_complate.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -31,9 +31,9 @@ namespace sprout {
result,
sprout::size(result),
(Indexes >= offset && Indexes < offset + size && Indexes < offset + input_size
? (Indexes < offset + NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(middle, last)
? (Indexes < offset + NS_SSCRISK_CEL_OR_SPROUT::distance(middle, last)
? *sprout::next(middle, Indexes - offset)
: *sprout::prev(sprout::next(first, Indexes - offset), NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, middle))
: *sprout::prev(sprout::next(first, Indexes - offset), NS_SSCRISK_CEL_OR_SPROUT::distance(first, middle))
)
: *sprout::next(sprout::internal_begin(result), Indexes)
)...
@ -56,7 +56,7 @@ namespace sprout {
typename sprout::index_range<0, sprout::container_traits<Result>::static_size>::type(),
sprout::internal_begin_offset(result),
sprout::size(result),
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, last)
NS_SSCRISK_CEL_OR_SPROUT::distance(first, last)
);
}
template<typename ForwardIterator, typename Result, typename... Args>

View file

@ -8,7 +8,7 @@
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/detail/container_complate.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -102,7 +102,7 @@ namespace sprout {
first2,
last2,
result,
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less<typename sprout::container_traits<Result>::value_type>(),
NS_SSCRISK_CEL_OR_SPROUT::less<typename sprout::container_traits<Result>::value_type>(),
sprout::size(result)
);
}

View file

@ -8,7 +8,7 @@
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/detail/container_complate.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -102,7 +102,7 @@ namespace sprout {
first2,
last2,
result,
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less<typename sprout::container_traits<Result>::value_type>(),
NS_SSCRISK_CEL_OR_SPROUT::less<typename sprout::container_traits<Result>::value_type>(),
sprout::size(result)
);
}

View file

@ -8,7 +8,7 @@
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/detail/container_complate.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -102,7 +102,7 @@ namespace sprout {
first2,
last2,
result,
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less<typename sprout::container_traits<Result>::value_type>(),
NS_SSCRISK_CEL_OR_SPROUT::less<typename sprout::container_traits<Result>::value_type>(),
sprout::size(result)
);
}

View file

@ -8,7 +8,7 @@
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/detail/container_complate.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -102,7 +102,7 @@ namespace sprout {
first2,
last2,
result,
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less<typename sprout::container_traits<Result>::value_type>(),
NS_SSCRISK_CEL_OR_SPROUT::less<typename sprout::container_traits<Result>::value_type>(),
sprout::size(result)
);
}

View file

@ -43,7 +43,6 @@ namespace sprout {
UniformRandomNumberGenerator&& g
)
{
return n > 0
? sprout::fixed::detail::make_shuffle_indexes_1(
n,

View file

@ -8,8 +8,8 @@
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/algorithm/fixed/swap_element.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -206,7 +206,7 @@ namespace sprout {
return sprout::fixed::detail::sort_start(
cont,
sprout::internal_begin_offset(cont),
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(sprout::internal_begin(cont), sprout::end(cont) - 1),
NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), sprout::end(cont) - 1),
comp
);
}
@ -231,8 +231,8 @@ namespace sprout {
return sprout::fixed::detail::sort_start(
cont,
sprout::internal_begin_offset(cont),
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(sprout::internal_begin(cont), sprout::end(cont) - 1),
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less<typename sprout::container_traits<Container>::value_type>()
NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), sprout::end(cont) - 1),
NS_SSCRISK_CEL_OR_SPROUT::less<typename sprout::container_traits<Container>::value_type>()
);
}
} // namespace detail

View file

@ -8,7 +8,7 @@
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/algorithm/fixed/swap_element.hpp>
#include <sprout/algorithm/fixed/pop_heap.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -63,7 +63,7 @@ namespace sprout {
{
return sprout::fixed::detail::sort_heap_impl(
cont,
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less<typename sprout::container_traits<Container>::value_type>(),
NS_SSCRISK_CEL_OR_SPROUT::less<typename sprout::container_traits<Container>::value_type>(),
sprout::internal_begin_offset(cont),
sprout::size(cont)
);

View file

@ -194,7 +194,7 @@ namespace sprout {
{
return sprout::fixed::detail::stable_sort_impl(
cont,
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::less<typename sprout::container_traits<Container>::value_type>(),
NS_SSCRISK_CEL_OR_SPROUT::less<typename sprout::container_traits<Container>::value_type>(),
sprout::size(cont)
);
}

View file

@ -10,7 +10,7 @@
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/detail/container_complate.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -60,7 +60,7 @@ namespace sprout {
typename sprout::index_range<0, sprout::container_traits<Result>::static_size>::type(),
sprout::internal_begin_offset(result),
sprout::size(result),
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, last)
NS_SSCRISK_CEL_OR_SPROUT::distance(first, last)
);
}
template<typename InputIterator, typename Result, typename... Args>

View file

@ -10,7 +10,7 @@
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/detail/container_complate.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
namespace fixed {
@ -53,7 +53,7 @@ namespace sprout {
typename sprout::index_range<0, sprout::container_traits<Result>::static_size>::type(),
sprout::internal_begin_offset(result),
sprout::size(result),
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first, last)
NS_SSCRISK_CEL_OR_SPROUT::distance(first, last)
);
}
template<typename InputIterator, typename Result, typename UnaryOperation, typename... Args>
@ -158,7 +158,7 @@ namespace sprout {
typename sprout::index_range<0, sprout::container_traits<Result>::static_size>::type(),
sprout::internal_begin_offset(result),
sprout::size(result),
NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(first1, last1)
NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1)
);
}
template<typename InputIterator1, typename InputIterator2, typename Result, typename BinaryOperation, typename... Args>

View file

@ -0,0 +1,32 @@
#ifndef SPROUT_ALGORITHM_INCLUDES_HPP
#define SPROUT_ALGORITHM_INCLUDES_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.4.5.1 includes
template<typename InputIterator1, typename InputIterator2>
SPROUT_CONSTEXPR bool includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2) {
return first2 == last2 ? true
: first1 == last1 ? false
: !(*first1 < *first2) && !(*first2 < *first1)
? sprout::includes(sprout::next(first1), last1, sprout::next(first2), last2)
: sprout::includes(sprout::next(first1), last1, first2, last2)
;
}
template<typename InputIterator1, typename InputIterator2, typename Compare>
SPROUT_CONSTEXPR bool includes(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, Compare comp) {
return first2 == last2 ? true
: first1 == last1 ? false
: !comp(*first1, *first2) && !comp(*first2, *first1)
? sprout::includes(sprout::next(first1), last1, sprout::next(first2), last2)
: sprout::includes(sprout::next(first1), last1, first2, last2)
;
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_INCLUDES_HPP

View file

@ -0,0 +1,22 @@
#ifndef SPROUT_ALGORITHM_IS_HEAP_HPP
#define SPROUT_ALGORITHM_IS_HEAP_HPP
#include <sprout/config.hpp>
#include <sprout/algorithm/is_heap_until.hpp>
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.4.6.5 is_heap
template<typename RandomAccessIterator>
SPROUT_CONSTEXPR bool is_heap(RandomAccessIterator first, RandomAccessIterator last) {
return sprout::is_heap_until(first, last) == last;
}
template<typename RandomAccessIterator, typename Compare>
SPROUT_CONSTEXPR bool is_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp) {
return sprout::is_heap_until(first, last, comp) == last;
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_IS_HEAP_HPP

View file

@ -0,0 +1,40 @@
#ifndef SPROUT_ALGORITHM_IS_HEAP_UNTIL_HPP
#define SPROUT_ALGORITHM_IS_HEAP_UNTIL_HPP
#include <cstddef>
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
namespace detail {
template<typename RandomAccessIterator, typename Compare>
SPROUT_CONSTEXPR RandomAccessIterator is_heap_until_impl(
RandomAccessIterator first,
RandomAccessIterator last,
Compare comp,
std::size_t n
)
{
return first + n == last || !comp(first[n], first[(n - 1) / 2]) ? first + n
: sprout::detail::is_heap_until_impl(first, last, comp, n + 1)
;
}
} // namespace detail
// 25.4.6.5 is_heap
template<typename RandomAccessIterator>
SPROUT_CONSTEXPR RandomAccessIterator is_heap_until(RandomAccessIterator first, RandomAccessIterator last) {
return sprout::is_heap_until(first, last, NS_SSCRISK_CEL_OR_SPROUT::less<decltype(*first)>());
}
template<typename RandomAccessIterator, typename Compare>
SPROUT_CONSTEXPR RandomAccessIterator is_heap_until(RandomAccessIterator first, RandomAccessIterator last, Compare comp) {
return NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) < 2 ? last : sprout::detail::is_heap_until_impl(first, last, comp, 1);
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_IS_HEAP_UNTIL_HPP

View file

@ -0,0 +1,28 @@
#ifndef SPROUT_ALGORITHM_IS_PARTITIONED_HPP
#define SPROUT_ALGORITHM_IS_PARTITIONED_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
namespace detail {
template<typename InputIterator, typename Predicate>
SPROUT_CONSTEXPR bool is_partitioned_impl(InputIterator first, InputIterator last, Predicate pred, bool cond = true) {
return first == last ? true
: cond ? sprout::detail::is_partitioned_impl(sprout::next(first), last, pred, pred(*first))
: pred(*first) ? false
: sprout::detail::is_partitioned_impl(sprout::next(first), last, pred, false)
;
}
} // namespace detail
// 25.3.13 Partitions
template<typename InputIterator, typename Predicate>
SPROUT_CONSTEXPR bool is_partitioned(InputIterator first, InputIterator last, Predicate pred) {
return sprout::detail::is_partitioned_impl(first, last, pred);
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_IS_PARTITIONED_HPP

View file

@ -0,0 +1,74 @@
#ifndef SPROUT_ALGORITHM_IS_PERMUTATION_HPP
#define SPROUT_ALGORITHM_IS_PERMUTATION_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/algorithm/count.hpp>
#include <sprout/algorithm/count_if.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
namespace detail {
template<typename ForwardIterator1, typename ForwardIterator2>
SPROUT_CONSTEXPR bool is_permutation_impl(
ForwardIterator1 first1,
ForwardIterator1 last1,
ForwardIterator2 first2,
ForwardIterator1 first1_
)
{
return first1_ == last1 ? true
: sprout::count(first1, last1, *first1_)
== sprout::count(first2, first2 + NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1), *first1_)
&& sprout::detail::is_permutation_impl(first1, last1, first2, sprout::next(first1_))
? true
: false
;
}
template<typename ForwardIterator1, typename ForwardIterator2, typename BinaryPredicate>
SPROUT_CONSTEXPR bool is_permutation_impl(
ForwardIterator1 first1,
ForwardIterator1 last1,
ForwardIterator2 first2,
ForwardIterator1 first1_,
BinaryPredicate pred
)
{
return first1_ == last1 ? true
: sprout::count_if(first1, last1, NS_SSCRISK_CEL_OR_SPROUT::bind2nd(pred, *first1_))
== sprout::count_if(first2, first2 + NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1), NS_SSCRISK_CEL_OR_SPROUT::bind2nd(pred, *first1_))
&& sprout::detail::is_permutation_impl(first1, last1, first2, sprout::next(first1_), pred)
? true
: false
;
}
} // namespace detail
// 25.2.12 Is permutation
template<typename ForwardIterator1, typename ForwardIterator2>
SPROUT_CONSTEXPR bool is_permutation(
ForwardIterator1 first1,
ForwardIterator1 last1,
ForwardIterator2 first2
)
{
return sprout::detail::is_permutation_impl(first1, last1, first2, first1);
}
template<typename ForwardIterator1, typename ForwardIterator2, typename BinaryPredicate>
SPROUT_CONSTEXPR bool is_permutation(
ForwardIterator1 first1,
ForwardIterator1 last1,
ForwardIterator2 first2,
BinaryPredicate pred
)
{
return sprout::detail::is_permutation_impl(first1, last1, first2, first1, pred);
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_IS_PERMUTATION_HPP

View file

@ -0,0 +1,22 @@
#ifndef SPROUT_ALGORITHM_IS_SORTED_HPP
#define SPROUT_ALGORITHM_IS_SORTED_HPP
#include <sprout/config.hpp>
#include <sprout/algorithm/is_sorted_until.hpp>
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.4.1.5 is_sorted
template<typename ForwardIterator>
SPROUT_CONSTEXPR bool is_sorted(ForwardIterator first, ForwardIterator last) {
return sprout::is_sorted_until(first, last) == last;
}
template<typename ForwardIterator, typename Compare>
SPROUT_CONSTEXPR bool is_sorted(ForwardIterator first, ForwardIterator last, Compare comp) {
return sprout::is_sorted_until(first, last, comp) == last;
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_IS_SORTED_HPP

View file

@ -0,0 +1,28 @@
#ifndef SPROUT_ALGORITHM_IS_SORTED_UNTIL_HPP
#define SPROUT_ALGORITHM_IS_SORTED_UNTIL_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.4.1.5 is_sorted
template<typename ForwardIterator>
SPROUT_CONSTEXPR ForwardIterator is_sorted_until(ForwardIterator first, ForwardIterator last) {
return first == last || sprout::next(first) == last ? last
: *(sprout::next(first)) < *first ? sprout::next(first)
: sprout::is_sorted_until(sprout::next(first), last)
;
}
template<typename ForwardIterator, typename Compare>
SPROUT_CONSTEXPR ForwardIterator is_sorted_until(ForwardIterator first, ForwardIterator last, Compare comp) {
return first == last || sprout::next(first) == last ? last
: comp(*(sprout::next(first)), *first) != false ? sprout::next(first)
: sprout::is_sorted_until(sprout::next(first), last)
;
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_IS_SORTED_UNTIL_HPP

View file

@ -0,0 +1,40 @@
#ifndef SPROUT_ALGORITHM_LEXICOGRAPHICAL_COMPARE_HPP
#define SPROUT_ALGORITHM_LEXICOGRAPHICAL_COMPARE_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.4.8 Lexicographical comparison
template<typename InputIterator1, typename InputIterator2, typename Compare>
SPROUT_CONSTEXPR bool lexicographical_compare(
InputIterator1 first1,
InputIterator1 last1,
InputIterator2 first2,
InputIterator2 last2,
Compare comp
)
{
return first2 == last2 ? false
: first1 == last1 || comp(*first1, *first2) ? true
: comp(*first2, *first1) ? false
: sprout::lexicographical_compare(sprout::next(first1), last1, sprout::next(first2), last2, comp)
;
}
template<typename InputIterator1, typename InputIterator2>
SPROUT_CONSTEXPR bool lexicographical_compare(
InputIterator1 first1,
InputIterator1 last1,
InputIterator2 first2,
InputIterator2 last2
)
{
return sprout::lexicographical_compare(first1, last1, first2, last2, NS_SSCRISK_CEL_OR_SPROUT::less<decltype(*first1 + *first2)>());
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_LEXICOGRAPHICAL_COMPARE_HPP

View file

@ -0,0 +1,33 @@
#ifndef SPROUT_ALGORITHM_LOWER_BOUND_HPP
#define SPROUT_ALGORITHM_LOWER_BOUND_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.4.3.1 lower_bound
template<typename ForwardIterator, typename T>
SPROUT_CONSTEXPR ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last, T const& value) {
return first == last ? last
: sprout::next(first) == last ? *first < value ? last : first
: *(first + NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) / 2) < value
? sprout::lower_bound(first + NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) / 2, last, value)
: sprout::lower_bound(first, first + NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) / 2, value)
;
}
template<typename ForwardIterator, typename T, typename Compare>
SPROUT_CONSTEXPR ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last, T const& value, Compare comp) {
return first == last ? last
: sprout::next(first) == last ? comp(*first, value) ? last : first
: comp(*(first + NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) / 2), value)
? sprout::lower_bound(first + NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) / 2, last, value, comp)
: sprout::lower_bound(first, first + NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) / 2, value, comp)
;
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_LOWER_BOUND_HPP

22
sprout/algorithm/max.hpp Normal file
View file

@ -0,0 +1,22 @@
#ifndef SPROUT_ALGORITHM_MAX_HPP
#define SPROUT_ALGORITHM_MAX_HPP
#include <sprout/config.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.4.7 Minimum and maximum
template<typename T, typename Compare>
SPROUT_CONSTEXPR T const& max(T const& a, T const& b, Compare comp) {
return comp(a, b) ? b : a;
}
template<typename T>
SPROUT_CONSTEXPR T const& max(T const& a, T const& b) {
return sprout::max(a, b, NS_SSCRISK_CEL_OR_SPROUT::less<T>());
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_MAX_HPP

View file

@ -0,0 +1,39 @@
#ifndef SPROUT_ALGORITHM_MAX_ELEMENT_HPP
#define SPROUT_ALGORITHM_MAX_ELEMENT_HPP
#include <iterator>
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
namespace detail {
template<typename ForwardIterator, typename Compare>
SPROUT_CONSTEXPR ForwardIterator max_element_impl(
ForwardIterator first,
ForwardIterator last,
Compare comp,
ForwardIterator max
)
{
return first == last ? max
: sprout::detail::max_element_impl(sprout::next(first), last, comp, comp(*max, *first) ? first : max)
;
}
} // namespace detail
// 25.4.7 Minimum and maximum
template<typename ForwardIterator, typename Compare>
SPROUT_CONSTEXPR ForwardIterator max_element(ForwardIterator first, ForwardIterator last, Compare comp) {
return sprout::detail::max_element_impl(first, last, comp, first);
}
template<typename ForwardIterator>
SPROUT_CONSTEXPR ForwardIterator max_element(ForwardIterator first, ForwardIterator last) {
return sprout::max_element(first, last, NS_SSCRISK_CEL_OR_SPROUT::less<typename std::iterator_traits<ForwardIterator>::value_type>());
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_MAX_ELEMENT_HPP

22
sprout/algorithm/min.hpp Normal file
View file

@ -0,0 +1,22 @@
#ifndef SPROUT_ALGORITHM_MIN_HPP
#define SPROUT_ALGORITHM_MIN_HPP
#include <sprout/config.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.4.7 Minimum and maximum
template<typename T, typename Compare>
SPROUT_CONSTEXPR T const& min(T const& a, T const& b, Compare comp) {
return comp(b, a) ? b : a;
}
template<typename T>
SPROUT_CONSTEXPR T const& min(T const& a, T const& b) {
return sprout::min(a, b, NS_SSCRISK_CEL_OR_SPROUT::less<T>());
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_MIN_HPP

View file

@ -0,0 +1,39 @@
#ifndef SPROUT_ALGORITHM_MIN_ELEMENT_HPP
#define SPROUT_ALGORITHM_MIN_ELEMENT_HPP
#include <iterator>
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
namespace detail {
template<typename ForwardIterator, typename Compare>
SPROUT_CONSTEXPR ForwardIterator min_element_impl(
ForwardIterator first,
ForwardIterator last,
Compare comp,
ForwardIterator min
)
{
return first == last ? min
: sprout::detail::min_element_impl(sprout::next(first), last, comp, comp(*first, *min) ? first : min)
;
}
} // namespace detail
// 25.4.7 Minimum and maximum
template<typename ForwardIterator, typename Compare>
SPROUT_CONSTEXPR ForwardIterator min_element(ForwardIterator first, ForwardIterator last, Compare comp) {
return sprout::detail::min_element_impl(first, last, comp, first);
}
template<typename ForwardIterator>
SPROUT_CONSTEXPR ForwardIterator min_element(ForwardIterator first, ForwardIterator last) {
return sprout::min_element(first, last, NS_SSCRISK_CEL_OR_SPROUT::less<typename std::iterator_traits<ForwardIterator>::value_type>());
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_MIN_ELEMENT_HPP

View file

@ -0,0 +1,23 @@
#ifndef SPROUT_ALGORITHM_MINMAX_HPP
#define SPROUT_ALGORITHM_MINMAX_HPP
#include <sprout/config.hpp>
#include <sprout/utility/pair.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.4.7 Minimum and maximum
template<typename T, typename Compare>
SPROUT_CONSTEXPR sprout::pair<T, T> minmax(T const& a, T const& b, Compare comp) {
return comp(b, a) ? sprout::pair<T, T>(b, a) : sprout::pair<T, T>(a, b);
}
template<typename T>
SPROUT_CONSTEXPR sprout::pair<T, T> minmax(T const& a, T const& b) {
return sprout::minmax(a, b, NS_SSCRISK_CEL_OR_SPROUT::less<T>());
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_MINMAX_HPP

View file

@ -0,0 +1,41 @@
#ifndef SPROUT_ALGORITHM_MINMAX_ELEMENT_HPP
#define SPROUT_ALGORITHM_MINMAX_ELEMENT_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/utility/pair.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
namespace detail {
template<typename ForwardIterator, typename Compare>
SPROUT_CONSTEXPR sprout::pair<ForwardIterator, ForwardIterator> minmax_element_impl(
ForwardIterator first,
ForwardIterator last,
Compare comp,
ForwardIterator min,
ForwardIterator max
)
{
return first == last ? sprout::pair<ForwardIterator, ForwardIterator>(min, max)
: comp(*first, *min) ? sprout::detail::minmax_element_impl(sprout::next(first), last, comp, first, max)
: sprout::detail::minmax_element_impl(sprout::next(first), last, comp, min, comp(*first, *max) ? max : first)
;
}
} // namespace detail
// 25.4.7 Minimum and maximum
template<typename ForwardIterator, typename Compare>
SPROUT_CONSTEXPR pair<ForwardIterator, ForwardIterator> minmax_element(ForwardIterator first, ForwardIterator last, Compare comp) {
return sprout::detail::minmax_element_impl(first, last, comp, first, first);
}
template<typename ForwardIterator>
SPROUT_CONSTEXPR pair<ForwardIterator, ForwardIterator> minmax_element(ForwardIterator first, ForwardIterator last) {
return sprout::minmax_element(first, last, NS_SSCRISK_CEL_OR_SPROUT::less<typename std::iterator_traits<ForwardIterator>::value_type>());
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_MINMAX_ELEMENT_HPP

View file

@ -0,0 +1,40 @@
#ifndef SPROUT_ALGORITHM_MISMATCH_HPP
#define SPROUT_ALGORITHM_MISMATCH_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/utility/pair.hpp>
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.2.10 Mismatch
template<typename InputIterator1, typename InputIterator2>
SPROUT_CONSTEXPR sprout::pair<InputIterator1, InputIterator2> mismatch(
InputIterator1 first1,
InputIterator1 last1,
InputIterator2 first2
)
{
return first1 == last1 || !(*first1 == *first2)
? sprout::pair<InputIterator1, InputIterator2>{first1, first2}
: sprout::mismatch(sprout::next(first1), last1, sprout::next(first2))
;
}
template<typename InputIterator1, typename InputIterator2, typename BinaryPredicate>
SPROUT_CONSTEXPR sprout::pair<InputIterator1, InputIterator2> mismatch(
InputIterator1 first1,
InputIterator1 last1,
InputIterator2 first2,
BinaryPredicate pred
)
{
return first1 == last1 || pred(*first1, *first2) == false
? sprout::pair<InputIterator1, InputIterator2>{first1, first2}
: sprout::mismatch(sprout::next(first1), last1, sprout::next(first2))
;
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_MISMATCH_HPP

View file

@ -0,0 +1,8 @@
#ifndef SPROUT_ALGORITHM_MODIFYIING_HPP
#define SPROUT_ALGORITHM_MODIFYIING_HPP
#include <sprout/config.hpp>
#include <sprout/algorithm/fixed.hpp>
#include <sprout/algorithm/fit.hpp>
#endif // #ifndef SPROUT_ALGORITHM_MODIFYIING_HPP

View file

@ -0,0 +1,40 @@
#ifndef SPROUT_ALGORITHM_NON_MODIFYIING_HPP
#define SPROUT_ALGORITHM_NON_MODIFYIING_HPP
#include <sprout/config.hpp>
#include <sprout/algorithm/all_of.hpp>
#include <sprout/algorithm/any_of.hpp>
#include <sprout/algorithm/none_of.hpp>
#include <sprout/algorithm/find.hpp>
#include <sprout/algorithm/find_if.hpp>
#include <sprout/algorithm/find_if_not.hpp>
#include <sprout/algorithm/find_end.hpp>
#include <sprout/algorithm/find_first_of.hpp>
#include <sprout/algorithm/adjacent_find.hpp>
#include <sprout/algorithm/count.hpp>
#include <sprout/algorithm/count_if.hpp>
#include <sprout/algorithm/mismatch.hpp>
#include <sprout/algorithm/equal.hpp>
#include <sprout/algorithm/is_permutation.hpp>
#include <sprout/algorithm/search.hpp>
#include <sprout/algorithm/search_n.hpp>
#include <sprout/algorithm/is_partitioned.hpp>
#include <sprout/algorithm/partition_point.hpp>
#include <sprout/algorithm/is_sorted.hpp>
#include <sprout/algorithm/is_sorted_until.hpp>
#include <sprout/algorithm/lower_bound.hpp>
#include <sprout/algorithm/upper_bound.hpp>
#include <sprout/algorithm/equal_range.hpp>
#include <sprout/algorithm/binary_search.hpp>
#include <sprout/algorithm/includes.hpp>
#include <sprout/algorithm/is_heap.hpp>
#include <sprout/algorithm/is_heap_until.hpp>
#include <sprout/algorithm/min.hpp>
#include <sprout/algorithm/max.hpp>
#include <sprout/algorithm/minmax.hpp>
#include <sprout/algorithm/min_element.hpp>
#include <sprout/algorithm/max_element.hpp>
#include <sprout/algorithm/minmax_element.hpp>
#include <sprout/algorithm/lexicographical_compare.hpp>
#endif // #ifndef SPROUT_ALGORITHM_NON_MODIFYIING_HPP

View file

@ -0,0 +1,19 @@
#ifndef SPROUT_ALGORITHM_NONE_OF_HPP
#define SPROUT_ALGORITHM_NONE_OF_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.2.3 None of
template <typename InputIterator, typename Predicate>
SPROUT_CONSTEXPR bool none_of(InputIterator first, InputIterator last, Predicate pred) {
return first == last ? true
: pred(*first) == false && sprout::none_of(sprout::next(first), last, pred)
;
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_NONE_OF_HPP

View file

@ -0,0 +1,28 @@
#ifndef SPROUT_ALGORITHM_PARTITION_POINT_HPP
#define SPROUT_ALGORITHM_PARTITION_POINT_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
namespace detail {
template<typename ForwardIterator, typename Predicate>
SPROUT_CONSTEXPR ForwardIterator partition_point_impl(ForwardIterator first, ForwardIterator last, Predicate pred, ForwardIterator mid) {
return mid == last ? mid
: pred(*mid) ? sprout::detail::partition_point_impl(mid + 1, last, pred, mid + 1 + NS_SSCRISK_CEL_OR_SPROUT::distance(mid + 1, last) / 2)
: sprout::detail::partition_point_impl(first, mid, pred, first + NS_SSCRISK_CEL_OR_SPROUT::distance(first, mid) / 2)
;
}
} // namespace detail
// 25.3.13 Partitions
template<typename ForwardIterator, typename Predicate>
SPROUT_CONSTEXPR ForwardIterator partition_point(ForwardIterator first, ForwardIterator last, Predicate pred) {
return sprout::detail::partition_point_impl(first, last, pred, first + NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) / 2);
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_PARTITION_POINT_HPP

View file

@ -0,0 +1,48 @@
#ifndef SPROUT_ALGORITHM_SEARCH_HPP
#define SPROUT_ALGORITHM_SEARCH_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.2.13 Search
template<typename ForwardIterator1, typename ForwardIterator2>
SPROUT_CONSTEXPR ForwardIterator1 search(
ForwardIterator1 first1,
ForwardIterator1 last1,
ForwardIterator2 first2,
ForwardIterator2 last2
)
{
return first1 == last1 || first2 == last2 ? first1
: NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1) < NS_SSCRISK_CEL_OR_SPROUT::distance(first2, last2) ? last1
: *first1 == *first2
&& sprout::search(sprout::next(first1), last1, sprout::next(first2), last2) == sprout::next(first1)
? first1
: sprout::search(sprout::next(first1), last1, first2, last2)
;
}
template<typename ForwardIterator1, typename ForwardIterator2, typename BinaryPredicate>
SPROUT_CONSTEXPR ForwardIterator1 search(
ForwardIterator1 first1,
ForwardIterator1 last1,
ForwardIterator2 first2,
ForwardIterator2 last2,
BinaryPredicate pred
)
{
return first1 == last1 || first2 == last2 ? first1
: NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1) < NS_SSCRISK_CEL_OR_SPROUT::distance(first2, last2) ? last1
: *first1 == *first2
&& sprout::search(sprout::next(first1), last1, sprout::next(first2), last2, pred) == sprout::next(first1)
? first1
: sprout::search(sprout::next(first1), last1, first2, last2, pred)
;
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_SEARCH_HPP

View file

@ -0,0 +1,47 @@
#ifndef SPROUT_ALGORITHM_SEARCH_N_HPP
#define SPROUT_ALGORITHM_SEARCH_N_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.2.13 Search
template<typename ForwardIterator, typename Size, typename T>
SPROUT_CONSTEXPR ForwardIterator search_n(
ForwardIterator first,
ForwardIterator last,
Size count,
T const& value
)
{
return first == last || count == 0 ? first
: sprout::next(first) == last && count > 1 ? last
: *first == value
&& sprout::search_n(sprout::next(first), last, count - 1, value) == sprout::next(first)
? first
: sprout::search_n(sprout::next(first), last, count, value)
;
}
template<typename ForwardIterator, typename Size, typename T, typename BinaryPredicate>
SPROUT_CONSTEXPR ForwardIterator search_n(
ForwardIterator first,
ForwardIterator last,
Size count,
T const& value,
BinaryPredicate pred
)
{
return first == last || count == 0 ? first
: sprout::next(first) == last && count > 1 ? last
: *first == value
&& sprout::search_n(sprout::next(first), last, count - 1, value, pred) == sprout::next(first)
? first
: sprout::search_n(sprout::next(first), last, count, value, pred)
;
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_SEARCH_N_HPP

View file

@ -0,0 +1,33 @@
#ifndef SPROUT_ALGORITHM_UPPER_BOUND_HPP
#define SPROUT_ALGORITHM_UPPER_BOUND_HPP
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
// Copyright (C) 2011 RiSK (sscrisk)
// 25.4.3.2 upper_bound
template<typename ForwardIterator, typename T>
SPROUT_CONSTEXPR ForwardIterator upper_bound(ForwardIterator first, ForwardIterator last, T const& value) {
return first == last ? last
: sprout::next(first) == last ? !(value < *first) ? last : first
: !(value < *(first + NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) / 2))
? upper_bound(first + NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) / 2, last, value)
: sprout::upper_bound(first, first + NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) / 2, value)
;
}
template<typename ForwardIterator, typename T, typename Compare>
SPROUT_CONSTEXPR ForwardIterator upper_bound(ForwardIterator first, ForwardIterator last, T const& value, Compare comp) {
return first == last ? last
: sprout::next(first) == last ? !comp(value, *first) ? last : first
: !comp(value, *(first + NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) / 2))
? sprout::upper_bound(first + NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) / 2, last, value, comp)
: sprout::upper_bound(first, first + NS_SSCRISK_CEL_OR_SPROUT::distance(first, last) / 2, value, comp)
;
}
} // namespace sprout
#endif // #ifndef SPROUT_ALGORITHM_UPPER_BOUND_HPP

View file

@ -12,7 +12,7 @@
#include <sprout/container/functions.hpp>
#include <sprout/iterator.hpp>
#include <sprout/utility/forward.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#if SPROUT_USE_INDEX_ITERATOR_IMPLEMENTATION
# include <sprout/iterator/index_iterator.hpp>
#endif
@ -196,7 +196,7 @@ namespace sprout {
//
template<typename T, std::size_t N>
SPROUT_CONSTEXPR inline bool operator==(sprout::array<T, N> const& lhs, sprout::array<T, N> const& rhs) {
return NS_SSCRISK_CEL_OR_SPROUT_DETAIL::equal(lhs.begin(), lhs.end(), rhs.begin());
return NS_SSCRISK_CEL_OR_SPROUT::equal(lhs.begin(), lhs.end(), rhs.begin());
}
template<typename T, std::size_t N>
SPROUT_CONSTEXPR inline bool operator!=(sprout::array<T, N> const& lhs, sprout::array<T, N> const& rhs) {
@ -204,7 +204,7 @@ namespace sprout {
}
template<typename T, std::size_t N>
SPROUT_CONSTEXPR inline bool operator<(sprout::array<T, N> const& lhs, sprout::array<T, N> const& rhs) {
return NS_SSCRISK_CEL_OR_SPROUT_DETAIL::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
return NS_SSCRISK_CEL_OR_SPROUT::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
}
template<typename T, std::size_t N>
SPROUT_CONSTEXPR inline bool operator>(sprout::array<T, N> const& lhs, sprout::array<T, N> const& rhs) {

7
sprout/cctype.hpp Normal file
View file

@ -0,0 +1,7 @@
#ifndef SPROUT_CCTYPE_HPP
#define SPROUT_CCTYPE_HPP
#include <sprout/config.hpp>
#include <sprout/ctype.hpp>
#endif // #ifndef SPROUT_CCTYPE_HPP

View file

@ -30,15 +30,15 @@
#endif // #ifndef SPROUT_CONFIG_DISABLE_USER_DEFINED_LITERALS
#ifndef SPROUT_CONFIG_USE_SSCRISK_CEL
# define HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL <sprout/detail/functional.hpp>
# define HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL <sprout/detail/algorithm.hpp>
# define HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL <sprout/detail/iterator.hpp>
# define NS_SSCRISK_CEL_OR_SPROUT_DETAIL sprout::detail
# define HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT <sprout/functional.hpp>
# define HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT <sprout/algorithm/non_modifying.hpp>
# define HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT <sprout/iterator.hpp>
# define NS_SSCRISK_CEL_OR_SPROUT sprout
#else // #ifndef SPROUT_CONFIG_USE_SSCRISK_CEL
# define HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT_DETAIL <sscrisk/cel/functional.hpp>
# define HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL <sscrisk/cel/algorithm.hpp>
# define HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL <sscrisk/cel/iterator.hpp>
# define NS_SSCRISK_CEL_OR_SPROUT_DETAIL sscrisk::cel
# define HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT <sscrisk/cel/functional.hpp>
# define HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT <sscrisk/cel/algorithm.hpp>
# define HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT <sscrisk/cel/iterator.hpp>
# define NS_SSCRISK_CEL_OR_SPROUT sscrisk::cel
#endif // #ifndef SPROUT_CONFIG_USE_SSCRISK_CEL
#ifndef SPROUT_CONFIG_DISABLE_SUPPORT_TEMPORARY_CONTAINER_ITERATION

View file

@ -5,7 +5,7 @@
#include <sprout/container/container_traits.hpp>
#include <sprout/container/begin.hpp>
#include <sprout/container/internal_begin.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
//
@ -13,7 +13,7 @@ namespace sprout {
//
template<typename Container>
SPROUT_CONSTEXPR typename sprout::container_traits<Container>::difference_type internal_begin_offset(Container const& cont) {
return NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(sprout::internal_begin(cont), sprout::begin(cont));
return NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), sprout::begin(cont));
}
} // namespace sprout

View file

@ -5,7 +5,7 @@
#include <sprout/container/container_traits.hpp>
#include <sprout/container/begin.hpp>
#include <sprout/container/internal_end.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
//
@ -13,7 +13,7 @@ namespace sprout {
//
template<typename Container>
SPROUT_CONSTEXPR typename sprout::container_traits<Container>::difference_type internal_begin_offset_backward(Container const& cont) {
return NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(sprout::begin(cont), sprout::internal_end(cont));
return NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::begin(cont), sprout::internal_end(cont));
}
} // namespace sprout

View file

@ -5,7 +5,7 @@
#include <sprout/container/container_traits.hpp>
#include <sprout/container/end.hpp>
#include <sprout/container/internal_begin.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
//
@ -13,7 +13,7 @@ namespace sprout {
//
template<typename Container>
SPROUT_CONSTEXPR typename sprout::container_traits<Container>::difference_type internal_end_offset(Container const& cont) {
return NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(sprout::internal_begin(cont), sprout::end(cont));
return NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::internal_begin(cont), sprout::end(cont));
}
} // namespace sprout

View file

@ -5,7 +5,7 @@
#include <sprout/container/container_traits.hpp>
#include <sprout/container/end.hpp>
#include <sprout/container/internal_end.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
//
@ -13,7 +13,7 @@ namespace sprout {
//
template<typename Container>
SPROUT_CONSTEXPR typename sprout::container_traits<Container>::difference_type internal_end_offset_backward(Container const& cont) {
return NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(sprout::end(cont), sprout::internal_end(cont));
return NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::end(cont), sprout::internal_end(cont));
}
} // namespace sprout

View file

@ -5,7 +5,7 @@
#include <sprout/container/container_traits.hpp>
#include <sprout/container/begin.hpp>
#include <sprout/container/end.hpp>
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
namespace sprout {
//
@ -13,7 +13,7 @@ namespace sprout {
//
template<typename Container>
SPROUT_CONSTEXPR inline typename sprout::container_traits<Container>::difference_type size(Container const& cont) {
return NS_SSCRISK_CEL_OR_SPROUT_DETAIL::distance(sprout::begin(cont), sprout::end(cont));
return NS_SSCRISK_CEL_OR_SPROUT::distance(sprout::begin(cont), sprout::end(cont));
}
} // namespace sprout

8
sprout/cstdlib.hpp Normal file
View file

@ -0,0 +1,8 @@
#ifndef SPROUT_CSTDLIB_HPP
#define SPROUT_CSTDLIB_HPP
#include <sprout/config.hpp>
#include <sprout/cstdlib/abs.hpp>
#include <sprout/cstdlib/div.hpp>
#endif // #ifndef SPROUT_CSTDLIB_HPP

Some files were not shown because too many files have changed in this diff Show more