mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2024-12-23 21:25:49 +00:00
add new signatures: some algorithms
This commit is contained in:
parent
9a593cbb81
commit
48f1b2d615
12 changed files with 137 additions and 9 deletions
|
@ -54,8 +54,8 @@
|
|||
#include <sprout/algorithm/fit/prev_permutation.hpp>
|
||||
#include <sprout/algorithm/fit/copy_while.hpp>
|
||||
#include <sprout/algorithm/fit/copy_until.hpp>
|
||||
#include <sprout/algorithm/fit/clamp_range_copy.hpp>
|
||||
#include <sprout/algorithm/fit/clamp_range.hpp>
|
||||
#include <sprout/algorithm/fit/clamp_range_copy.hpp>
|
||||
#include <sprout/algorithm/fit/random_swap.hpp>
|
||||
#include <sprout/algorithm/fit/random_swap_result.hpp>
|
||||
#include <sprout/algorithm/fit/bogo_sort.hpp>
|
||||
|
|
|
@ -54,8 +54,8 @@
|
|||
#include <sprout/algorithm/fixed/prev_permutation.hpp>
|
||||
#include <sprout/algorithm/fixed/copy_while.hpp>
|
||||
#include <sprout/algorithm/fixed/copy_until.hpp>
|
||||
#include <sprout/algorithm/fixed/clamp_range_copy.hpp>
|
||||
#include <sprout/algorithm/fixed/clamp_range.hpp>
|
||||
#include <sprout/algorithm/fixed/clamp_range_copy.hpp>
|
||||
#include <sprout/algorithm/fixed/swap_element.hpp>
|
||||
#include <sprout/algorithm/fixed/swap_element_copy.hpp>
|
||||
#include <sprout/algorithm/fixed/random_swap.hpp>
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <sprout/container/functions.hpp>
|
||||
#include <sprout/iterator/operation.hpp>
|
||||
#include <sprout/algorithm/fixed/result_of.hpp>
|
||||
#include <sprout/pit.hpp>
|
||||
#include <sprout/detail/container_complate.hpp>
|
||||
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
|
||||
|
||||
|
@ -100,6 +101,26 @@ namespace sprout {
|
|||
sprout::size(result)
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Result, typename InputIterator1, typename InputIterator2, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
|
||||
merge(
|
||||
InputIterator1 first1, InputIterator1 last1,
|
||||
InputIterator2 first2, InputIterator2 last2,
|
||||
Compare comp
|
||||
)
|
||||
{
|
||||
return sprout::fixed::merge(first1, last1, first2, last2, sprout::pit<Result>(), comp);
|
||||
}
|
||||
template<typename Result, typename InputIterator1, typename InputIterator2>
|
||||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
|
||||
merge(
|
||||
InputIterator1 first1, InputIterator1 last1,
|
||||
InputIterator2 first2, InputIterator2 last2
|
||||
)
|
||||
{
|
||||
return sprout::fixed::merge(first1, last1, first2, last2, sprout::pit<Result>());
|
||||
}
|
||||
} // namespace fixed
|
||||
|
||||
using sprout::fixed::merge;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <sprout/container/functions.hpp>
|
||||
#include <sprout/iterator/operation.hpp>
|
||||
#include <sprout/algorithm/fixed/result_of.hpp>
|
||||
#include <sprout/pit.hpp>
|
||||
#include <sprout/detail/container_complate.hpp>
|
||||
|
||||
namespace sprout {
|
||||
|
@ -50,10 +51,13 @@ namespace sprout {
|
|||
template<typename InputIterator, typename Result, typename Predicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
|
||||
partition_copy(InputIterator first, InputIterator last, Result const& result, Predicate pred) {
|
||||
return sprout::fixed::detail::partition_copy_impl(
|
||||
first, last, result, pred,
|
||||
sprout::size(result)
|
||||
);
|
||||
return sprout::fixed::detail::partition_copy_impl(first, last, result, pred, sprout::size(result));
|
||||
}
|
||||
|
||||
template<typename Result, typename InputIterator, typename Predicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
|
||||
partition_copy(InputIterator first, InputIterator last, Predicate pred) {
|
||||
return sprout::fixed::partition_copy(first, last, sprout::pit<Result>(), pred);
|
||||
}
|
||||
} // namespace fixed
|
||||
|
||||
|
|
|
@ -48,9 +48,7 @@ namespace sprout {
|
|||
)
|
||||
{
|
||||
return sprout::fixed::detail::rotate_copy_impl_ra(
|
||||
first,
|
||||
middle,
|
||||
last,
|
||||
first, middle, last,
|
||||
result,
|
||||
sprout::index_range<0, sprout::container_traits<Result>::static_size>::make(),
|
||||
sprout::internal_begin_offset(result),
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <sprout/container/functions.hpp>
|
||||
#include <sprout/iterator/operation.hpp>
|
||||
#include <sprout/algorithm/fixed/result_of.hpp>
|
||||
#include <sprout/pit.hpp>
|
||||
#include <sprout/detail/container_complate.hpp>
|
||||
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
|
||||
|
||||
|
@ -105,6 +106,26 @@ namespace sprout {
|
|||
sprout::size(result)
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Result, typename InputIterator1, typename InputIterator2, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
|
||||
set_difference(
|
||||
InputIterator1 first1, InputIterator1 last1,
|
||||
InputIterator2 first2, InputIterator2 last2,
|
||||
Compare comp
|
||||
)
|
||||
{
|
||||
return sprout::fixed::set_difference(first1, last1, first2, last2, sprout::pit<Result>(), comp);
|
||||
}
|
||||
template<typename Result, typename InputIterator1, typename InputIterator2>
|
||||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
|
||||
set_difference(
|
||||
InputIterator1 first1, InputIterator1 last1,
|
||||
InputIterator2 first2, InputIterator2 last2
|
||||
)
|
||||
{
|
||||
return sprout::fixed::set_difference(first1, last1, first2, last2, sprout::pit<Result>());
|
||||
}
|
||||
} // namespace fixed
|
||||
|
||||
using sprout::fixed::set_difference;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <sprout/container/functions.hpp>
|
||||
#include <sprout/iterator/operation.hpp>
|
||||
#include <sprout/algorithm/fixed/result_of.hpp>
|
||||
#include <sprout/pit.hpp>
|
||||
#include <sprout/detail/container_complate.hpp>
|
||||
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
|
||||
|
||||
|
@ -105,6 +106,26 @@ namespace sprout {
|
|||
sprout::size(result)
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Result, typename InputIterator1, typename InputIterator2, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
|
||||
set_intersection(
|
||||
InputIterator1 first1, InputIterator1 last1,
|
||||
InputIterator2 first2, InputIterator2 last2,
|
||||
Compare comp
|
||||
)
|
||||
{
|
||||
return sprout::fixed::set_intersection(first1, last1, first2, last2, sprout::pit<Result>(), comp);
|
||||
}
|
||||
template<typename Result, typename InputIterator1, typename InputIterator2>
|
||||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
|
||||
set_intersection(
|
||||
InputIterator1 first1, InputIterator1 last1,
|
||||
InputIterator2 first2, InputIterator2 last2
|
||||
)
|
||||
{
|
||||
return sprout::fixed::set_intersection(first1, last1, first2, last2, sprout::pit<Result>());
|
||||
}
|
||||
} // namespace fixed
|
||||
|
||||
using sprout::fixed::set_intersection;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <sprout/container/functions.hpp>
|
||||
#include <sprout/iterator/operation.hpp>
|
||||
#include <sprout/algorithm/fixed/result_of.hpp>
|
||||
#include <sprout/pit.hpp>
|
||||
#include <sprout/detail/container_complate.hpp>
|
||||
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
|
||||
|
||||
|
@ -105,6 +106,26 @@ namespace sprout {
|
|||
sprout::size(result)
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Result, typename InputIterator1, typename InputIterator2, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
|
||||
set_symmetric_difference(
|
||||
InputIterator1 first1, InputIterator1 last1,
|
||||
InputIterator2 first2, InputIterator2 last2,
|
||||
Compare comp
|
||||
)
|
||||
{
|
||||
return sprout::fixed::set_symmetric_difference(first1, last1, first2, last2, sprout::pit<Result>(), comp);
|
||||
}
|
||||
template<typename Result, typename InputIterator1, typename InputIterator2>
|
||||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
|
||||
set_symmetric_difference(
|
||||
InputIterator1 first1, InputIterator1 last1,
|
||||
InputIterator2 first2, InputIterator2 last2
|
||||
)
|
||||
{
|
||||
return sprout::fixed::set_symmetric_difference(first1, last1, first2, last2, sprout::pit<Result>());
|
||||
}
|
||||
} // namespace fixed
|
||||
|
||||
using sprout::fixed::set_symmetric_difference;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <sprout/container/functions.hpp>
|
||||
#include <sprout/iterator/operation.hpp>
|
||||
#include <sprout/algorithm/fixed/result_of.hpp>
|
||||
#include <sprout/pit.hpp>
|
||||
#include <sprout/detail/container_complate.hpp>
|
||||
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
|
||||
|
||||
|
@ -105,6 +106,26 @@ namespace sprout {
|
|||
sprout::size(result)
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Result, typename InputIterator1, typename InputIterator2, typename Compare>
|
||||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
|
||||
set_union(
|
||||
InputIterator1 first1, InputIterator1 last1,
|
||||
InputIterator2 first2, InputIterator2 last2,
|
||||
Compare comp
|
||||
)
|
||||
{
|
||||
return sprout::fixed::set_union(first1, last1, first2, last2, sprout::pit<Result>(), comp);
|
||||
}
|
||||
template<typename Result, typename InputIterator1, typename InputIterator2>
|
||||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
|
||||
set_union(
|
||||
InputIterator1 first1, InputIterator1 last1,
|
||||
InputIterator2 first2, InputIterator2 last2
|
||||
)
|
||||
{
|
||||
return sprout::fixed::set_union(first1, last1, first2, last2, sprout::pit<Result>());
|
||||
}
|
||||
} // namespace fixed
|
||||
|
||||
using sprout::fixed::set_union;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <sprout/container/functions.hpp>
|
||||
#include <sprout/iterator/operation.hpp>
|
||||
#include <sprout/algorithm/fixed/result_of.hpp>
|
||||
#include <sprout/pit.hpp>
|
||||
#include <sprout/detail/container_complate.hpp>
|
||||
|
||||
namespace sprout {
|
||||
|
@ -105,6 +106,12 @@ namespace sprout {
|
|||
stable_partition_copy(BidirectionalIterator first, BidirectionalIterator last, Result const& result, Predicate pred) {
|
||||
return sprout::fixed::detail::stable_partition_copy_impl(first, last, result, pred, sprout::size(result), first);
|
||||
}
|
||||
|
||||
template<typename Result, typename BidirectionalIterator, typename Predicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
|
||||
stable_partition_copy(BidirectionalIterator first, BidirectionalIterator last, Predicate pred) {
|
||||
return sprout::fixed::stable_partition_copy(first, last, sprout::pit<Result>(), pred);
|
||||
}
|
||||
} // namespace fixed
|
||||
|
||||
using sprout::fixed::stable_partition_copy;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <sprout/container/functions.hpp>
|
||||
#include <sprout/iterator/operation.hpp>
|
||||
#include <sprout/algorithm/fixed/result_of.hpp>
|
||||
#include <sprout/pit.hpp>
|
||||
#include <sprout/detail/container_complate.hpp>
|
||||
|
||||
namespace sprout {
|
||||
|
@ -116,6 +117,12 @@ namespace sprout {
|
|||
typedef typename std::iterator_traits<ForwardIterator>::iterator_category* category;
|
||||
return sprout::fixed::detail::swap_element_copy(first, last, result, pos1, pos2, category());
|
||||
}
|
||||
|
||||
template<typename Result, typename ForwardIterator>
|
||||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
|
||||
swap_element_copy(ForwardIterator first, ForwardIterator last, ForwardIterator pos1, ForwardIterator pos2) {
|
||||
return sprout::fixed::swap_element_copy(first, last, sprout::pit<Result>(), pos1, pos2);
|
||||
}
|
||||
} // namespace fixed
|
||||
|
||||
using sprout::fixed::swap_element_copy;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <sprout/container/functions.hpp>
|
||||
#include <sprout/iterator/operation.hpp>
|
||||
#include <sprout/algorithm/fixed/result_of.hpp>
|
||||
#include <sprout/pit.hpp>
|
||||
#include <sprout/detail/container_complate.hpp>
|
||||
|
||||
namespace sprout {
|
||||
|
@ -108,6 +109,12 @@ namespace sprout {
|
|||
: sprout::detail::container_complate(result)
|
||||
;
|
||||
}
|
||||
|
||||
template<typename Result, typename InputIterator, typename BinaryPredicate>
|
||||
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
|
||||
unique_copy(InputIterator first, InputIterator last, BinaryPredicate pred) {
|
||||
return sprout::fixed::unique_copy(first, last, sprout::pit<Result>(), pred);
|
||||
}
|
||||
} // namespace fixed
|
||||
|
||||
using sprout::fixed::unique_copy;
|
||||
|
|
Loading…
Reference in a new issue