mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-05-10 09:23:30 +00:00
add C++14 constexpr range algorithms
This commit is contained in:
parent
856fb90150
commit
cd16923347
57 changed files with 2022 additions and 12 deletions
|
@ -18,11 +18,11 @@ namespace sprout {
|
||||||
// 25.3.2 Move
|
// 25.3.2 Move
|
||||||
//
|
//
|
||||||
template<
|
template<
|
||||||
typename InputIterator, typename OutputIterator,
|
typename BidirectionalIterator1, typename BidirectionalIterator2,
|
||||||
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
typename sprout::enabler_if<sprout::is_iterator_outputable<BidirectionalIterator2>::value>::type = sprout::enabler
|
||||||
>
|
>
|
||||||
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
inline SPROUT_CXX14_CONSTEXPR BidirectionalIterator2
|
||||||
move_backward(InputIterator first, InputIterator last, OutputIterator result) {
|
move_backward(BidirectionalIterator1 first, BidirectionalIterator1 last, BidirectionalIterator2 result) {
|
||||||
while (first != last) {
|
while (first != last) {
|
||||||
*--result = sprout::move(*--first);
|
*--result = sprout::move(*--first);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
/*=============================================================================
|
/*=============================================================================
|
||||||
Copyright (c) 2011-2014 Bolero MURAKAMI
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
https://github.com/bolero-MURAKAMI/Sprout
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
=============================================================================*/
|
=============================================================================*/
|
||||||
#ifndef SPROUT_RANDOM_UNIFORM_01_HPP
|
#ifndef SPROUT_RANDOM_UNIFORM_01_HPP
|
||||||
#define SPROUT_RANDOM_UNIFORM_01_HPP
|
#define SPROUT_RANDOM_UNIFORM_01_HPP
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
/*=============================================================================
|
/*=============================================================================
|
||||||
Copyright (c) 2011-2014 Bolero MURAKAMI
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
https://github.com/bolero-MURAKAMI/Sprout
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
=============================================================================*/
|
=============================================================================*/
|
||||||
#ifndef SPROUT_RANDOM_UNIFORM_REAL_DISTRIBUTION_HPP
|
#ifndef SPROUT_RANDOM_UNIFORM_REAL_DISTRIBUTION_HPP
|
||||||
#define SPROUT_RANDOM_UNIFORM_REAL_DISTRIBUTION_HPP
|
#define SPROUT_RANDOM_UNIFORM_REAL_DISTRIBUTION_HPP
|
||||||
|
|
65
sprout/range/algorithm/cxx14.hpp
Normal file
65
sprout/range/algorithm/cxx14.hpp
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/copy.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/copy_if.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/copy_backward.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/move.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/move_backward.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/swap_ranges.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/transform.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/replace.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/replace_if.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/replace_copy.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/replace_copy_if.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/fill.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/generate.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/remove.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/remove_if.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/remove_copy.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/remove_copy_if.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/unique.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/unique_copy.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/reverse.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/reverse_copy.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/rotate.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/rotate_copy.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/random_shuffle.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/shuffle.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/partition.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/stable_partition.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/partition_copy.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/sort.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/stable_sort.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/partial_sort.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/partial_sort_copy.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/nth_element.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/merge.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/inplace_merge.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/set_union.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/set_intersection.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/set_difference.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/set_symmetric_difference.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/push_heap.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/pop_heap.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/make_heap.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/sort_heap.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/next_permutation.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/prev_permutation.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/sample.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/copy_while.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/copy_until.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/clamp_range.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/random_swap.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/bogo_sort.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14/bozo_sort.hpp>
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_HPP
|
40
sprout/range/algorithm/cxx14/bogo_sort.hpp
Normal file
40
sprout/range/algorithm/cxx14/bogo_sort.hpp
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_BOGO_SORT_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_BOGO_SORT_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/bogo_sort.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// bogo_sort
|
||||||
|
//
|
||||||
|
template<typename RandomAccessRange, typename UniformRandomNumberGenerator>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
bogo_sort(RandomAccessRange&& rng, UniformRandomNumberGenerator&& g) {
|
||||||
|
sprout::bogo_sort(
|
||||||
|
sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)),
|
||||||
|
SPROUT_FORWARD(UniformRandomNumberGenerator, g)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
template<typename RandomAccessRange, typename UniformRandomNumberGenerator, typename Compare>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
bogo_sort(RandomAccessRange&& rng, UniformRandomNumberGenerator&& g, Compare comp) {
|
||||||
|
sprout::bogo_sort(
|
||||||
|
sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)),
|
||||||
|
SPROUT_FORWARD(UniformRandomNumberGenerator, g), comp
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_BOGO_SORT_HPP
|
40
sprout/range/algorithm/cxx14/bozo_sort.hpp
Normal file
40
sprout/range/algorithm/cxx14/bozo_sort.hpp
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_BOZO_SORT_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_BOZO_SORT_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/bozo_sort.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// bozo_sort
|
||||||
|
//
|
||||||
|
template<typename RandomAccessRange, typename UniformRandomNumberGenerator>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
bozo_sort(RandomAccessRange&& rng, UniformRandomNumberGenerator&& g) {
|
||||||
|
sprout::bozo_sort(
|
||||||
|
sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)),
|
||||||
|
SPROUT_FORWARD(UniformRandomNumberGenerator, g)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
template<typename RandomAccessRange, typename UniformRandomNumberGenerator, typename Compare>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
bozo_sort(RandomAccessRange&& rng, UniformRandomNumberGenerator&& g, Compare comp) {
|
||||||
|
sprout::bozo_sort(
|
||||||
|
sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)),
|
||||||
|
SPROUT_FORWARD(UniformRandomNumberGenerator, g), comp
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_BOZO_SORT_HPP
|
53
sprout/range/algorithm/cxx14/clamp_range.hpp
Normal file
53
sprout/range/algorithm/cxx14/clamp_range.hpp
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_CLAMP_RANGE_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_CLAMP_RANGE_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/traits.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/clamp_range.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// clamp_range
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename InputRange, typename OutputIterator, typename Compare,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
clamp_range(
|
||||||
|
InputRange const& rng, OutputIterator result,
|
||||||
|
typename sprout::container_traits<InputRange>::value_type const& low,
|
||||||
|
typename sprout::container_traits<InputRange>::value_type const& high,
|
||||||
|
Compare comp
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return sprout::clamp_range(sprout::begin(rng), sprout::end(rng), result, low, high, comp);
|
||||||
|
}
|
||||||
|
template<
|
||||||
|
typename InputRange, typename OutputIterator,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
clamp_range(
|
||||||
|
InputRange const& rng, OutputIterator result,
|
||||||
|
typename sprout::container_traits<InputRange>::value_type const& low,
|
||||||
|
typename sprout::container_traits<InputRange>::value_type const& high
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return sprout::clamp_range(sprout::begin(rng), sprout::end(rng), result, low, high);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_CLAMP_RANGE_HPP
|
33
sprout/range/algorithm/cxx14/copy.hpp
Normal file
33
sprout/range/algorithm/cxx14/copy.hpp
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_COPY_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_COPY_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/copy.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// copy
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename InputRange, typename OutputIterator,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
copy(InputRange const& rng, OutputIterator result) {
|
||||||
|
return sprout::copy(sprout::begin(rng), sprout::end(rng), result);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_COPY_HPP
|
33
sprout/range/algorithm/cxx14/copy_backward.hpp
Normal file
33
sprout/range/algorithm/cxx14/copy_backward.hpp
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_COPY_BACKWARD_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_COPY_BACKWARD_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/copy_backward.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// copy_backward
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename BidirectionalRange, typename BidirectionalIterator,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<BidirectionalIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR BidirectionalIterator
|
||||||
|
copy_backward(BidirectionalRange const& rng, BidirectionalIterator result) {
|
||||||
|
return sprout::copy_backward(sprout::begin(rng), sprout::end(rng), result);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_COPY_BACKWARD_HPP
|
33
sprout/range/algorithm/cxx14/copy_if.hpp
Normal file
33
sprout/range/algorithm/cxx14/copy_if.hpp
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_COPY_IF_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_COPY_IF_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/copy_if.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// copy_if
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename InputRange, typename OutputIterator, typename Predicate,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
copy_if(InputRange const& rng, OutputIterator result, Predicate pred) {
|
||||||
|
return sprout::copy_if(sprout::begin(rng), sprout::end(rng), result, pred);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_COPY_IF_HPP
|
33
sprout/range/algorithm/cxx14/copy_until.hpp
Normal file
33
sprout/range/algorithm/cxx14/copy_until.hpp
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_COPY_UNTIL_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_COPY_UNTIL_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/copy_until.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// copy_until
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename InputRange, typename OutputIterator, typename Predicate,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
copy_until(InputRange const& rng, OutputIterator result, Predicate pred) {
|
||||||
|
return sprout::copy_until(sprout::begin(rng), sprout::end(rng), result, pred);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_COPY_UNTIL_HPP
|
33
sprout/range/algorithm/cxx14/copy_while.hpp
Normal file
33
sprout/range/algorithm/cxx14/copy_while.hpp
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_COPY_WHILE_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_COPY_WHILE_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/copy_while.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// copy_while
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename InputRange, typename OutputIterator, typename Predicate,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
copy_while(InputRange const& rng, OutputIterator result, Predicate pred) {
|
||||||
|
return sprout::copy_while(sprout::begin(rng), sprout::end(rng), result, pred);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_COPY_WHILE_HPP
|
29
sprout/range/algorithm/cxx14/fill.hpp
Normal file
29
sprout/range/algorithm/cxx14/fill.hpp
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_FILL_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_FILL_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/fill.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// fill
|
||||||
|
//
|
||||||
|
template<typename ForwardRange, typename T>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
fill(ForwardRange&& rng, T const& value) {
|
||||||
|
sprout::fill(sprout::begin(SPROUT_FORWARD(ForwardRange, rng)), sprout::end(SPROUT_FORWARD(ForwardRange, rng)), value);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_FILL_HPP
|
29
sprout/range/algorithm/cxx14/generate.hpp
Normal file
29
sprout/range/algorithm/cxx14/generate.hpp
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_GENERATE_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_GENERATE_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/generate.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// generate
|
||||||
|
//
|
||||||
|
template<typename ForwardRange, typename Generator>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
generate(ForwardRange&& rng, Generator gen) {
|
||||||
|
sprout::generate(sprout::begin(SPROUT_FORWARD(ForwardRange, rng)), sprout::end(SPROUT_FORWARD(ForwardRange, rng)), gen);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_GENERATE_HPP
|
37
sprout/range/algorithm/cxx14/inplace_merge.hpp
Normal file
37
sprout/range/algorithm/cxx14/inplace_merge.hpp
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_IMPLACE_MERGE_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_IMPLACE_MERGE_HPP
|
||||||
|
|
||||||
|
#include <type_traits>
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/traits.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/inplace_merge.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// inplace_merge
|
||||||
|
//
|
||||||
|
template<typename BidirectionalRange, typename Compare>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
inplace_merge(BidirectionalRange&& rng, typename sprout::container_traits<typename::std::remove_reference<BidirectionalRange>::type>::iterator middle, Compare comp) {
|
||||||
|
sprout::inplace_merge(sprout::begin(SPROUT_FORWARD(BidirectionalRange, rng)), middle, sprout::end(SPROUT_FORWARD(BidirectionalRange, rng)), comp);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename BidirectionalRange>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
inplace_merge(BidirectionalRange&& rng, typename sprout::container_traits<typename::std::remove_reference<BidirectionalRange>::type>::iterator middle) {
|
||||||
|
sprout::inplace_merge(sprout::begin(SPROUT_FORWARD(BidirectionalRange, rng)), middle, sprout::end(SPROUT_FORWARD(BidirectionalRange, rng)));
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_IMPLACE_MERGE_HPP
|
35
sprout/range/algorithm/cxx14/make_heap.hpp
Normal file
35
sprout/range/algorithm/cxx14/make_heap.hpp
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_MAKE_HEAP_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_MAKE_HEAP_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/make_heap.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// make_heap
|
||||||
|
//
|
||||||
|
template<typename RandomAccessRange, typename Compare>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
make_heap(RandomAccessRange&& rng, Compare comp) {
|
||||||
|
sprout::make_heap(sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)), comp);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename RandomAccessRange>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
make_heap(RandomAccessRange&& rng) {
|
||||||
|
sprout::make_heap(sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)));
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_MAKE_HEAP_HPP
|
41
sprout/range/algorithm/cxx14/merge.hpp
Normal file
41
sprout/range/algorithm/cxx14/merge.hpp
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_MERGE_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_MERGE_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/merge.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// merge
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename InputRange1, typename InputRange2, typename OutputIterator, typename Compare,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
merge(InputRange1 const& rng1, InputRange2 const& rng2, OutputIterator result, Compare comp) {
|
||||||
|
return sprout::merge(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result, comp);
|
||||||
|
}
|
||||||
|
template<
|
||||||
|
typename InputRange1, typename InputRange2, typename OutputIterator,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
merge(InputRange1 const& rng1, InputRange2 const& rng2, OutputIterator result) {
|
||||||
|
return sprout::merge(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_MERGE_HPP
|
33
sprout/range/algorithm/cxx14/move.hpp
Normal file
33
sprout/range/algorithm/cxx14/move.hpp
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_MOVE_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_MOVE_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/move.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// move
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename InputRange, typename OutputIterator,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
move(InputRange const& rng, OutputIterator result) {
|
||||||
|
return sprout::move(sprout::begin(rng), sprout::end(rng), result);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_MOVE_HPP
|
33
sprout/range/algorithm/cxx14/move_backward.hpp
Normal file
33
sprout/range/algorithm/cxx14/move_backward.hpp
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_MOVE_BACKWARD_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_COPY_BACKWARD_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/move_backward.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// move_backward
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename BidirectionalRange, typename BidirectionalIterator,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<BidirectionalIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR BidirectionalIterator
|
||||||
|
move_backward(BidirectionalRange const& rng, BidirectionalIterator result) {
|
||||||
|
return sprout::move_backward(sprout::begin(rng), sprout::end(rng), result);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_COPY_BACKWARD_HPP
|
35
sprout/range/algorithm/cxx14/next_permutation.hpp
Normal file
35
sprout/range/algorithm/cxx14/next_permutation.hpp
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_NEXT_PERMUTATION_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_NEXT_PERMUTATION_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/next_permutation.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// next_permutation
|
||||||
|
//
|
||||||
|
template<typename BidirectionalRange, typename Compare>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR bool
|
||||||
|
next_permutation(BidirectionalRange&& rng, Compare comp) {
|
||||||
|
return sprout::next_permutation(sprout::begin(SPROUT_FORWARD(BidirectionalRange, rng)), sprout::end(SPROUT_FORWARD(BidirectionalRange, rng)), comp);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename BidirectionalRange>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR bool
|
||||||
|
next_permutation(BidirectionalRange&& rng) {
|
||||||
|
return sprout::next_permutation(sprout::begin(SPROUT_FORWARD(BidirectionalRange, rng)), sprout::end(SPROUT_FORWARD(BidirectionalRange, rng)));
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_NEXT_PERMUTATION_HPP
|
37
sprout/range/algorithm/cxx14/nth_element.hpp
Normal file
37
sprout/range/algorithm/cxx14/nth_element.hpp
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_NTH_ELEMENT_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_NTH_ELEMENT_HPP
|
||||||
|
|
||||||
|
#include <type_traits>
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/traits.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/nth_element.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// nth_element
|
||||||
|
//
|
||||||
|
template<typename RandomAccessRange, typename Compare>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
nth_element(RandomAccessRange&& rng, typename sprout::container_traits<typename::std::remove_reference<RandomAccessRange>::type>::iterator nth, Compare comp) {
|
||||||
|
sprout::nth_element(sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), nth, sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)), comp);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename RandomAccessRange>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
nth_element(RandomAccessRange&& rng, typename sprout::container_traits<typename::std::remove_reference<RandomAccessRange>::type>::iterator nth) {
|
||||||
|
sprout::nth_element(sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), nth, sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)));
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_NTH_ELEMENT_HPP
|
37
sprout/range/algorithm/cxx14/partial_sort.hpp
Normal file
37
sprout/range/algorithm/cxx14/partial_sort.hpp
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_PARTIAL_SORT_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_PARTIAL_SORT_HPP
|
||||||
|
|
||||||
|
#include <type_traits>
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/traits.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/partial_sort.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// partial_sort
|
||||||
|
//
|
||||||
|
template<typename RandomAccessRange, typename Compare>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
partial_sort(RandomAccessRange&& rng, typename sprout::container_traits<typename::std::remove_reference<RandomAccessRange>::type>::iterator middle, Compare comp) {
|
||||||
|
sprout::partial_sort(sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), middle, sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)), comp);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename RandomAccessRange>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
partial_sort(RandomAccessRange&& rng, typename sprout::container_traits<typename::std::remove_reference<RandomAccessRange>::type>::iterator middle) {
|
||||||
|
sprout::partial_sort(sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), middle, sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)));
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_PARTIAL_SORT_HPP
|
73
sprout/range/algorithm/cxx14/partial_sort_copy.hpp
Normal file
73
sprout/range/algorithm/cxx14/partial_sort_copy.hpp
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_PARTIAL_SORT_COPY_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_PARTIAL_SORT_COPY_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/traits.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/range/range_return.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/partial_sort_copy.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// partial_sort_copy
|
||||||
|
//
|
||||||
|
template<typename InputRange, typename RandomAccessRange, typename Compare>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR typename sprout::range::range_return<RandomAccessRange>::type
|
||||||
|
partial_sort_copy(InputRange const& rng1, RandomAccessRange&& rng2, Compare comp) {
|
||||||
|
return sprout::range::range_return<RandomAccessRange>::pack(
|
||||||
|
sprout::partial_sort_copy(
|
||||||
|
sprout::begin(rng1), sprout::end(rng1),
|
||||||
|
sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng2)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng2)),
|
||||||
|
comp
|
||||||
|
),
|
||||||
|
SPROUT_FORWARD(RandomAccessRange, rng2)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
template<sprout::range::range_return_value RetV, typename InputRange, typename RandomAccessRange, typename Compare>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR typename sprout::range::range_return<RandomAccessRange, RetV>::type
|
||||||
|
partial_sort_copy(InputRange const& rng1, RandomAccessRange&& rng2, Compare comp) {
|
||||||
|
return sprout::range::range_return<RandomAccessRange, RetV>::pack(
|
||||||
|
sprout::partial_sort_copy(
|
||||||
|
sprout::begin(rng1), sprout::end(rng1),
|
||||||
|
sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng2)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng2)),
|
||||||
|
comp
|
||||||
|
),
|
||||||
|
SPROUT_FORWARD(RandomAccessRange, rng2)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename InputRange, typename RandomAccessRange>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR typename sprout::range::range_return<RandomAccessRange>::type
|
||||||
|
partial_sort_copy(InputRange const& rng1, RandomAccessRange&& rng2) {
|
||||||
|
return sprout::range::range_return<RandomAccessRange>::pack(
|
||||||
|
sprout::partial_sort_copy(
|
||||||
|
sprout::begin(rng1), sprout::end(rng1),
|
||||||
|
sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng2)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng2))
|
||||||
|
),
|
||||||
|
SPROUT_FORWARD(RandomAccessRange, rng2)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
template<sprout::range::range_return_value RetV, typename InputRange, typename RandomAccessRange>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR typename sprout::range::range_return<RandomAccessRange, RetV>::type
|
||||||
|
partial_sort_copy(InputRange const& rng1, RandomAccessRange&& rng2) {
|
||||||
|
return sprout::range::range_return<RandomAccessRange, RetV>::pack(
|
||||||
|
sprout::partial_sort_copy(
|
||||||
|
sprout::begin(rng1), sprout::end(rng1),
|
||||||
|
sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng2)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng2))
|
||||||
|
),
|
||||||
|
SPROUT_FORWARD(RandomAccessRange, rng2)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_PARTIAL_SORT_COPY_HPP
|
42
sprout/range/algorithm/cxx14/partition.hpp
Normal file
42
sprout/range/algorithm/cxx14/partition.hpp
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_PARTITION_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_PARTITION_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/range/range_return.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/partition.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// partition
|
||||||
|
//
|
||||||
|
template<typename ForwardRange, typename Predicate>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||||
|
partition(ForwardRange&& rng, Predicate pred) {
|
||||||
|
return sprout::range::range_return<ForwardRange>::pack(
|
||||||
|
sprout::partition(sprout::begin(SPROUT_FORWARD(ForwardRange, rng)), sprout::end(SPROUT_FORWARD(ForwardRange, rng)), pred),
|
||||||
|
SPROUT_FORWARD(ForwardRange, rng)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<sprout::range::range_return_value RetV, typename ForwardRange, typename Predicate>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||||
|
partition(ForwardRange&& rng, Predicate pred) {
|
||||||
|
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||||
|
sprout::partition(sprout::begin(SPROUT_FORWARD(ForwardRange, rng)), sprout::end(SPROUT_FORWARD(ForwardRange, rng)), pred),
|
||||||
|
SPROUT_FORWARD(ForwardRange, rng)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_PARTITION_HPP
|
33
sprout/range/algorithm/cxx14/partition_copy.hpp
Normal file
33
sprout/range/algorithm/cxx14/partition_copy.hpp
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_PARTITION_COPY_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_PARTITION_COPY_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/partition_copy.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// partition_copy
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename InputRange, typename OutputIterator, typename Predicate,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
partition_copy(InputRange const& rng, OutputIterator result, Predicate pred) {
|
||||||
|
return sprout::partition_copy(sprout::begin(rng), sprout::end(rng), result, pred);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_PARTITION_COPY_HPP
|
35
sprout/range/algorithm/cxx14/pop_heap.hpp
Normal file
35
sprout/range/algorithm/cxx14/pop_heap.hpp
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_POP_HEAP_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_POP_HEAP_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/pop_heap.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// pop_heap
|
||||||
|
//
|
||||||
|
template<typename RandomAccessRange, typename Compare>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
pop_heap(RandomAccessRange&& rng, Compare comp) {
|
||||||
|
sprout::pop_heap(sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)), comp);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename RandomAccessRange>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
pop_heap(RandomAccessRange&& rng) {
|
||||||
|
sprout::pop_heap(sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)));
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_POP_HEAP_HPP
|
35
sprout/range/algorithm/cxx14/prev_permutation.hpp
Normal file
35
sprout/range/algorithm/cxx14/prev_permutation.hpp
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_PREV_PERMUTATION_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_PREV_PERMUTATION_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/prev_permutation.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// prev_permutation
|
||||||
|
//
|
||||||
|
template<typename BidirectionalRange, typename Compare>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR bool
|
||||||
|
prev_permutation(BidirectionalRange&& rng, Compare comp) {
|
||||||
|
return sprout::prev_permutation(sprout::begin(SPROUT_FORWARD(BidirectionalRange, rng)), sprout::end(SPROUT_FORWARD(BidirectionalRange, rng)), comp);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename BidirectionalRange>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR bool
|
||||||
|
prev_permutation(BidirectionalRange&& rng) {
|
||||||
|
return sprout::prev_permutation(sprout::begin(SPROUT_FORWARD(BidirectionalRange, rng)), sprout::end(SPROUT_FORWARD(BidirectionalRange, rng)));
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_PREV_PERMUTATION_HPP
|
35
sprout/range/algorithm/cxx14/push_heap.hpp
Normal file
35
sprout/range/algorithm/cxx14/push_heap.hpp
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_PUSH_HEAP_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_PUSH_HEAP_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/push_heap.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// push_heap
|
||||||
|
//
|
||||||
|
template<typename RandomAccessRange, typename Compare>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
push_heap(RandomAccessRange&& rng, Compare comp) {
|
||||||
|
sprout::push_heap(sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)), comp);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename RandomAccessRange>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
push_heap(RandomAccessRange&& rng) {
|
||||||
|
sprout::push_heap(sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)));
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_PUSH_HEAP_HPP
|
32
sprout/range/algorithm/cxx14/random_shuffle.hpp
Normal file
32
sprout/range/algorithm/cxx14/random_shuffle.hpp
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_RANDOM_SHUFFLE_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_RANDOM_SHUFFLE_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/random_shuffle.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// random_shuffle
|
||||||
|
//
|
||||||
|
template<typename RandomAccessRange, typename RandomNumberGenerator>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
random_shuffle(RandomAccessRange&& rng, RandomNumberGenerator&& rand) {
|
||||||
|
sprout::random_shuffle(
|
||||||
|
sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)),
|
||||||
|
SPROUT_FORWARD(RandomNumberGenerator, rand)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_RANDOM_SHUFFLE_HPP
|
32
sprout/range/algorithm/cxx14/random_swap.hpp
Normal file
32
sprout/range/algorithm/cxx14/random_swap.hpp
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_RANDOM_SWAP_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_RANDOM_SWAP_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/random_swap.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// random_swap
|
||||||
|
//
|
||||||
|
template<typename RandomAccessRange, typename UniformRandomNumberGenerator>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
random_swap(RandomAccessRange&& rng, UniformRandomNumberGenerator&& g) {
|
||||||
|
sprout::random_swap(
|
||||||
|
sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)),
|
||||||
|
SPROUT_FORWARD(UniformRandomNumberGenerator, g)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_RANDOM_SWAP_HPP
|
42
sprout/range/algorithm/cxx14/remove.hpp
Normal file
42
sprout/range/algorithm/cxx14/remove.hpp
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_REMOVE_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_REMOVE_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/range/range_return.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/remove.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// remove
|
||||||
|
//
|
||||||
|
template<typename ForwardRange, typename T>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||||
|
remove(ForwardRange&& rng, T const& value) {
|
||||||
|
return sprout::range::range_return<ForwardRange>::pack(
|
||||||
|
sprout::remove(sprout::begin(SPROUT_FORWARD(ForwardRange, rng)), sprout::end(SPROUT_FORWARD(ForwardRange, rng)), value),
|
||||||
|
SPROUT_FORWARD(ForwardRange, rng)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<sprout::range::range_return_value RetV, typename ForwardRange, typename T>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||||
|
remove(ForwardRange&& rng, T const& value) {
|
||||||
|
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||||
|
sprout::remove(sprout::begin(SPROUT_FORWARD(ForwardRange, rng)), sprout::end(SPROUT_FORWARD(ForwardRange, rng)), value),
|
||||||
|
SPROUT_FORWARD(ForwardRange, rng)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_REMOVE_HPP
|
33
sprout/range/algorithm/cxx14/remove_copy.hpp
Normal file
33
sprout/range/algorithm/cxx14/remove_copy.hpp
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_REMOVE_COPY_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_REMOVE_COPY_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/remove_copy.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// remove_copy
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename InputRange, typename OutputIterator, typename T,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
remove_copy(InputRange const& rng, OutputIterator result, T const& value) {
|
||||||
|
return sprout::remove_copy(sprout::begin(rng), sprout::end(rng), result, value);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_REMOVE_COPY_HPP
|
33
sprout/range/algorithm/cxx14/remove_copy_if.hpp
Normal file
33
sprout/range/algorithm/cxx14/remove_copy_if.hpp
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_REMOVE_COPY_IF_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_REMOVE_COPY_IF_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/remove_copy_if.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// remove_copy_if
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename InputRange, typename OutputIterator, typename Predicate,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
remove_copy_if(InputRange const& rng, OutputIterator result, Predicate pred) {
|
||||||
|
return sprout::remove_copy_if(sprout::begin(rng), sprout::end(rng), result, pred);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_REMOVE_COPY_IF_HPP
|
42
sprout/range/algorithm/cxx14/remove_if.hpp
Normal file
42
sprout/range/algorithm/cxx14/remove_if.hpp
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_REMOVE_IF_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_REMOVE_IF_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/range/range_return.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/remove_if.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// remove_if
|
||||||
|
//
|
||||||
|
template<typename ForwardRange, typename Predicate>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||||
|
remove_if(ForwardRange&& rng, Predicate pred) {
|
||||||
|
return sprout::range::range_return<ForwardRange>::pack(
|
||||||
|
sprout::remove_if(sprout::begin(SPROUT_FORWARD(ForwardRange, rng)), sprout::end(SPROUT_FORWARD(ForwardRange, rng)), pred),
|
||||||
|
SPROUT_FORWARD(ForwardRange, rng)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<sprout::range::range_return_value RetV, typename ForwardRange, typename Predicate>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||||
|
remove_if(ForwardRange&& rng, Predicate pred) {
|
||||||
|
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||||
|
sprout::remove_if(sprout::begin(SPROUT_FORWARD(ForwardRange, rng)), sprout::end(SPROUT_FORWARD(ForwardRange, rng)), pred),
|
||||||
|
SPROUT_FORWARD(ForwardRange, rng)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_REMOVE_HPP
|
29
sprout/range/algorithm/cxx14/replace.hpp
Normal file
29
sprout/range/algorithm/cxx14/replace.hpp
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_REPLACE_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_REPLACE_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/replace.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// replace
|
||||||
|
//
|
||||||
|
template<typename ForwardRange, typename T>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
replace(ForwardRange&& rng, T const& old_value, T const& new_value) {
|
||||||
|
sprout::replace(sprout::begin(SPROUT_FORWARD(ForwardRange, rng)), sprout::end(SPROUT_FORWARD(ForwardRange, rng)), old_value, new_value);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_REPLACE_HPP
|
33
sprout/range/algorithm/cxx14/replace_copy.hpp
Normal file
33
sprout/range/algorithm/cxx14/replace_copy.hpp
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_REPLACE_COPY_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_REPLACE_COPY_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/replace_copy.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// replace_copy
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename InputRange, typename OutputIterator, typename T,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
replace_copy(InputRange const& rng, OutputIterator result, T const& old_value, T const& new_value) {
|
||||||
|
return sprout::replace_copy(sprout::begin(rng), sprout::end(rng), result, old_value, new_value);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_REPLACE_COPY_HPP
|
33
sprout/range/algorithm/cxx14/replace_copy_if.hpp
Normal file
33
sprout/range/algorithm/cxx14/replace_copy_if.hpp
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_REPLACE_COPY_IF_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_REPLACE_COPY_IF_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/replace_copy_if.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// replace_copy_if
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename InputRange, typename OutputIterator, typename T, typename Predicate,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
replace_copy_if(InputRange const& rng, OutputIterator result, Predicate pred, T const& new_value) {
|
||||||
|
return sprout::replace_copy_if(sprout::begin(rng), sprout::end(rng), result, pred, new_value);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_REPLACE_COPY_IF_HPP
|
29
sprout/range/algorithm/cxx14/replace_if.hpp
Normal file
29
sprout/range/algorithm/cxx14/replace_if.hpp
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_REPLACE_IF_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_REPLACE_IF_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/replace_if.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// replace_if
|
||||||
|
//
|
||||||
|
template<typename ForwardRange, typename Predicate, typename T>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
replace_if(ForwardRange&& rng, Predicate pred, T const& new_value) {
|
||||||
|
sprout::replace_if(sprout::begin(SPROUT_FORWARD(ForwardRange, rng)), sprout::end(SPROUT_FORWARD(ForwardRange, rng)), pred, new_value);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_REPLACE_IF_HPP
|
29
sprout/range/algorithm/cxx14/reverse.hpp
Normal file
29
sprout/range/algorithm/cxx14/reverse.hpp
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_REVERSE_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_REVERSE_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/reverse.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// reverse
|
||||||
|
//
|
||||||
|
template<typename BidirectionalRange>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
reverse(BidirectionalRange&& rng) {
|
||||||
|
sprout::reverse(sprout::begin(SPROUT_FORWARD(BidirectionalRange, rng)), sprout::end(SPROUT_FORWARD(BidirectionalRange, rng)));
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_REVERSE_HPP
|
33
sprout/range/algorithm/cxx14/reverse_copy.hpp
Normal file
33
sprout/range/algorithm/cxx14/reverse_copy.hpp
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_REVERSE_COPY_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_REVERSE_COPY_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/reverse_copy.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// reverse_copy
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename BidirectionalRange, typename OutputIterator,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
reverse_copy(BidirectionalRange const& rng, OutputIterator result) {
|
||||||
|
return sprout::reverse_copy(sprout::begin(rng), sprout::end(rng), result);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_REVERSE_COPY_HPP
|
44
sprout/range/algorithm/cxx14/rotate.hpp
Normal file
44
sprout/range/algorithm/cxx14/rotate.hpp
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_ROTATE_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_ROTATE_HPP
|
||||||
|
|
||||||
|
#include <type_traits>
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/traits.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/range/range_return.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/rotate.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// rotate
|
||||||
|
//
|
||||||
|
template<typename ForwardRange>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||||
|
rotate(ForwardRange&& rng, typename sprout::container_traits<typename::std::remove_reference<ForwardRange>::type>::iterator middle) {
|
||||||
|
return sprout::range::range_return<ForwardRange>::pack(
|
||||||
|
sprout::rotate(sprout::begin(SPROUT_FORWARD(ForwardRange, rng)), middle, sprout::end(SPROUT_FORWARD(ForwardRange, rng))),
|
||||||
|
SPROUT_FORWARD(ForwardRange, rng)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<sprout::range::range_return_value RetV, typename ForwardRange>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||||
|
rotate(ForwardRange&& rng, typename sprout::container_traits<typename::std::remove_reference<ForwardRange>::type>::iterator middle) {
|
||||||
|
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||||
|
sprout::rotate(sprout::begin(SPROUT_FORWARD(ForwardRange, rng)), middle, sprout::end(SPROUT_FORWARD(ForwardRange, rng))),
|
||||||
|
SPROUT_FORWARD(ForwardRange, rng)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_ROTATE_HPP
|
38
sprout/range/algorithm/cxx14/rotate_copy.hpp
Normal file
38
sprout/range/algorithm/cxx14/rotate_copy.hpp
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_ROTATE_COPY_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_ROTATE_COPY_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/traits.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/rotate_copy.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// rotate_copy
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename ForwardRange, typename OutputIterator,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
rotate_copy(
|
||||||
|
ForwardRange const& rng, typename sprout::container_traits<ForwardRange>::const_iterator middle,
|
||||||
|
OutputIterator result
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return sprout::rotate_copy(sprout::begin(rng), middle, sprout::end(rng), result);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_ROTATE_COPY_HPP
|
34
sprout/range/algorithm/cxx14/sample.hpp
Normal file
34
sprout/range/algorithm/cxx14/sample.hpp
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_SAMPLE_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_SAMPLE_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/sample.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// sample
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename PopRange, typename SampleIterator, typename Size, typename URNG,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<SampleIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR SampleIterator
|
||||||
|
sample(PopRange const& rng, SampleIterator out, Size n, URNG&& g) {
|
||||||
|
return sprout::sample(sprout::begin(rng), sprout::end(rng), out, n, SPROUT_FORWARD(URNG, g));
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_SAMPLE_HPP
|
41
sprout/range/algorithm/cxx14/set_difference.hpp
Normal file
41
sprout/range/algorithm/cxx14/set_difference.hpp
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_SET_DIFFERENCE_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_SET_DIFFERENCE_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/set_difference.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// set_difference
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename InputRange1, typename InputRange2, typename OutputIterator, typename Compare,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
set_difference(InputRange1 const& rng1, InputRange2 const& rng2, OutputIterator result, Compare comp) {
|
||||||
|
return sprout::set_difference(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result, comp);
|
||||||
|
}
|
||||||
|
template<
|
||||||
|
typename InputRange1, typename InputRange2, typename OutputIterator,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
set_difference(InputRange1 const& rng1, InputRange2 const& rng2, OutputIterator result) {
|
||||||
|
return sprout::set_difference(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_SET_DIFFERENCE_HPP
|
41
sprout/range/algorithm/cxx14/set_intersection.hpp
Normal file
41
sprout/range/algorithm/cxx14/set_intersection.hpp
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_SET_INTERSECTION_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_SET_INTERSECTION_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/set_intersection.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// set_intersection
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename InputRange1, typename InputRange2, typename OutputIterator, typename Compare,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
set_intersection(InputRange1 const& rng1, InputRange2 const& rng2, OutputIterator result, Compare comp) {
|
||||||
|
return sprout::set_intersection(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result, comp);
|
||||||
|
}
|
||||||
|
template<
|
||||||
|
typename InputRange1, typename InputRange2, typename OutputIterator,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
set_intersection(InputRange1 const& rng1, InputRange2 const& rng2, OutputIterator result) {
|
||||||
|
return sprout::set_intersection(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_SET_INTERSECTION_HPP
|
41
sprout/range/algorithm/cxx14/set_symmetric_difference.hpp
Normal file
41
sprout/range/algorithm/cxx14/set_symmetric_difference.hpp
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_SET_SYMMETRIC_DIFFERENCE_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_SET_SYMMETRIC_DIFFERENCE_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/set_symmetric_difference.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// set_symmetric_difference
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename InputRange1, typename InputRange2, typename OutputIterator, typename Compare,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
set_symmetric_difference(InputRange1 const& rng1, InputRange2 const& rng2, OutputIterator result, Compare comp) {
|
||||||
|
return sprout::set_symmetric_difference(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result, comp);
|
||||||
|
}
|
||||||
|
template<
|
||||||
|
typename InputRange1, typename InputRange2, typename OutputIterator,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
set_symmetric_difference(InputRange1 const& rng1, InputRange2 const& rng2, OutputIterator result) {
|
||||||
|
return sprout::set_symmetric_difference(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_SET_SYMMETRIC_DIFFERENCE_HPP
|
41
sprout/range/algorithm/cxx14/set_union.hpp
Normal file
41
sprout/range/algorithm/cxx14/set_union.hpp
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_SET_UNION_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_SET_UNION_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/set_union.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// set_union
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename InputRange1, typename InputRange2, typename OutputIterator, typename Compare,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
set_union(InputRange1 const& rng1, InputRange2 const& rng2, OutputIterator result, Compare comp) {
|
||||||
|
return sprout::set_union(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result, comp);
|
||||||
|
}
|
||||||
|
template<
|
||||||
|
typename InputRange1, typename InputRange2, typename OutputIterator,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
set_union(InputRange1 const& rng1, InputRange2 const& rng2, OutputIterator result) {
|
||||||
|
return sprout::set_union(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_SET_UNION_HPP
|
32
sprout/range/algorithm/cxx14/shuffle.hpp
Normal file
32
sprout/range/algorithm/cxx14/shuffle.hpp
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_SHUFFLE_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_SHUFFLE_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/shuffle.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// shuffle
|
||||||
|
//
|
||||||
|
template<typename RandomAccessRange, typename UniformRandomNumberGenerator>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
shuffle(RandomAccessRange&& rng, UniformRandomNumberGenerator&& g) {
|
||||||
|
sprout::shuffle(
|
||||||
|
sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)),
|
||||||
|
SPROUT_FORWARD(UniformRandomNumberGenerator, g)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_SHUFFLE_HPP
|
35
sprout/range/algorithm/cxx14/sort.hpp
Normal file
35
sprout/range/algorithm/cxx14/sort.hpp
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_SORT_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_SORT_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/sort.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// sort
|
||||||
|
//
|
||||||
|
template<typename RandomAccessRange, typename Compare>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
sort(RandomAccessRange&& rng, Compare comp) {
|
||||||
|
sprout::sort(sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)), comp);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename RandomAccessRange>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
sort(RandomAccessRange&& rng) {
|
||||||
|
sprout::sort(sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)));
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_SORT_HPP
|
35
sprout/range/algorithm/cxx14/sort_heap.hpp
Normal file
35
sprout/range/algorithm/cxx14/sort_heap.hpp
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_SORT_HEAP_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_SORT_HEAP_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/sort_heap.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// sort_heap
|
||||||
|
//
|
||||||
|
template<typename RandomAccessRange, typename Compare>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
sort_heap(RandomAccessRange&& rng, Compare comp) {
|
||||||
|
sprout::sort_heap(sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)), comp);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename RandomAccessRange>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
sort_heap(RandomAccessRange&& rng) {
|
||||||
|
sprout::sort_heap(sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)));
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_SORT_HEAP_HPP
|
42
sprout/range/algorithm/cxx14/stable_partition.hpp
Normal file
42
sprout/range/algorithm/cxx14/stable_partition.hpp
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_STABLE_PARTITION_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_STABLE_PARTITION_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/range/range_return.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/stable_partition.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// stable_partition
|
||||||
|
//
|
||||||
|
template<typename BidirectionalRange, typename Predicate>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR typename sprout::range::range_return<BidirectionalRange>::type
|
||||||
|
stable_partition(BidirectionalRange&& rng, Predicate pred) {
|
||||||
|
return sprout::range::range_return<BidirectionalRange>::pack(
|
||||||
|
sprout::stable_partition(sprout::begin(SPROUT_FORWARD(BidirectionalRange, rng)), sprout::end(SPROUT_FORWARD(BidirectionalRange, rng)), pred),
|
||||||
|
SPROUT_FORWARD(BidirectionalRange, rng)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<sprout::range::range_return_value RetV, typename BidirectionalRange, typename Predicate>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR typename sprout::range::range_return<BidirectionalRange, RetV>::type
|
||||||
|
stable_partition(BidirectionalRange&& rng, Predicate pred) {
|
||||||
|
return sprout::range::range_return<BidirectionalRange, RetV>::pack(
|
||||||
|
sprout::stable_partition(sprout::begin(SPROUT_FORWARD(BidirectionalRange, rng)), sprout::end(SPROUT_FORWARD(BidirectionalRange, rng)), pred),
|
||||||
|
SPROUT_FORWARD(BidirectionalRange, rng)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_STABLE_PARTITION_HPP
|
35
sprout/range/algorithm/cxx14/stable_sort.hpp
Normal file
35
sprout/range/algorithm/cxx14/stable_sort.hpp
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_STABLE_SORT_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_STABLE_SORT_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/stable_sort.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// stable_sort
|
||||||
|
//
|
||||||
|
template<typename RandomAccessRange, typename Compare>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
stable_sort(RandomAccessRange&& rng, Compare comp) {
|
||||||
|
sprout::stable_sort(sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)), comp);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename RandomAccessRange>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
|
stable_sort(RandomAccessRange&& rng) {
|
||||||
|
sprout::stable_sort(sprout::begin(SPROUT_FORWARD(RandomAccessRange, rng)), sprout::end(SPROUT_FORWARD(RandomAccessRange, rng)));
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_STABLE_SORT_HPP
|
48
sprout/range/algorithm/cxx14/swap_ranges.hpp
Normal file
48
sprout/range/algorithm/cxx14/swap_ranges.hpp
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_SWAP_RANGES_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_SWAP_RANGES_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/range/range_return.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/swap_ranges.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// swap_ranges
|
||||||
|
//
|
||||||
|
template<typename ForwardRange1, typename ForwardRange2>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR typename sprout::range::range_return<ForwardRange2>::type
|
||||||
|
swap_ranges(ForwardRange1&& rng1, ForwardRange2&& rng2) {
|
||||||
|
return sprout::range::range_return<ForwardRange2>::pack(
|
||||||
|
sprout::swap_ranges(
|
||||||
|
sprout::begin(SPROUT_FORWARD(ForwardRange1, rng1)), sprout::end(SPROUT_FORWARD(ForwardRange1, rng1)),
|
||||||
|
sprout::begin(SPROUT_FORWARD(ForwardRange2, rng2))
|
||||||
|
),
|
||||||
|
SPROUT_FORWARD(ForwardRange2, rng2)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<sprout::range::range_return_value RetV, typename ForwardRange1, typename ForwardRange2>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR typename sprout::range::range_return<ForwardRange2, RetV>::type
|
||||||
|
swap_ranges(ForwardRange1&& rng1, ForwardRange2&& rng2) {
|
||||||
|
return sprout::range::range_return<ForwardRange2, RetV>::pack(
|
||||||
|
sprout::swap_ranges(
|
||||||
|
sprout::begin(SPROUT_FORWARD(ForwardRange1, rng1)), sprout::end(SPROUT_FORWARD(ForwardRange1, rng1)),
|
||||||
|
sprout::begin(SPROUT_FORWARD(ForwardRange2, rng2))
|
||||||
|
),
|
||||||
|
SPROUT_FORWARD(ForwardRange2, rng2)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_SWAP_RANGES_HPP
|
41
sprout/range/algorithm/cxx14/transform.hpp
Normal file
41
sprout/range/algorithm/cxx14/transform.hpp
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_TRANSFORM_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_TRANSFORM_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/transform.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// transform
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename InputRange, typename OutputIterator, typename UnaryOperation,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
transform(InputRange const& rng, OutputIterator result, UnaryOperation op) {
|
||||||
|
return sprout::transform(sprout::begin(rng), sprout::end(rng), result, op);
|
||||||
|
}
|
||||||
|
template<
|
||||||
|
typename InputRange1, typename InputRange2, typename OutputIterator, typename BinaryOperation,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
transform(InputRange1 const& rng1, InputRange2 const& rng2, OutputIterator result, BinaryOperation op) {
|
||||||
|
return sprout::transform(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), result, op);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_TRANSFORM_HPP
|
58
sprout/range/algorithm/cxx14/unique.hpp
Normal file
58
sprout/range/algorithm/cxx14/unique.hpp
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_UNIQUE_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_UNIQUE_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/utility/forward.hpp>
|
||||||
|
#include <sprout/range/range_return.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/unique.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// unique
|
||||||
|
//
|
||||||
|
template<typename ForwardRange>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||||
|
unique(ForwardRange&& rng) {
|
||||||
|
return sprout::range::range_return<ForwardRange>::pack(
|
||||||
|
sprout::unique(sprout::begin(SPROUT_FORWARD(ForwardRange, rng)), sprout::end(SPROUT_FORWARD(ForwardRange, rng))),
|
||||||
|
SPROUT_FORWARD(ForwardRange, rng)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
template<sprout::range::range_return_value RetV, typename ForwardRange>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||||
|
unique(ForwardRange&& rng) {
|
||||||
|
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||||
|
sprout::unique(sprout::begin(SPROUT_FORWARD(ForwardRange, rng)), sprout::end(SPROUT_FORWARD(ForwardRange, rng))),
|
||||||
|
SPROUT_FORWARD(ForwardRange, rng)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename ForwardRange, typename BinaryPredicate>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR typename sprout::range::range_return<ForwardRange>::type
|
||||||
|
unique(ForwardRange&& rng, BinaryPredicate pred) {
|
||||||
|
return sprout::range::range_return<ForwardRange>::pack(
|
||||||
|
sprout::unique(sprout::begin(SPROUT_FORWARD(ForwardRange, rng)), sprout::end(SPROUT_FORWARD(ForwardRange, rng)), pred),
|
||||||
|
SPROUT_FORWARD(ForwardRange, rng)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
template<sprout::range::range_return_value RetV, typename ForwardRange, typename BinaryPredicate>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR typename sprout::range::range_return<ForwardRange, RetV>::type
|
||||||
|
unique(ForwardRange&& rng, BinaryPredicate pred) {
|
||||||
|
return sprout::range::range_return<ForwardRange, RetV>::pack(
|
||||||
|
sprout::unique(sprout::begin(SPROUT_FORWARD(ForwardRange, rng)), sprout::end(SPROUT_FORWARD(ForwardRange, rng)), pred),
|
||||||
|
SPROUT_FORWARD(ForwardRange, rng)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_UNIQUE_HPP
|
41
sprout/range/algorithm/cxx14/unique_copy.hpp
Normal file
41
sprout/range/algorithm/cxx14/unique_copy.hpp
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
/*=============================================================================
|
||||||
|
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||||
|
https://github.com/bolero-MURAKAMI/Sprout
|
||||||
|
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
=============================================================================*/
|
||||||
|
#ifndef SPROUT_RANGE_ALGORITHM_CXX14_UNIQUE_COPY_HPP
|
||||||
|
#define SPROUT_RANGE_ALGORITHM_CXX14_UNIQUE_COPY_HPP
|
||||||
|
|
||||||
|
#include <sprout/config.hpp>
|
||||||
|
#include <sprout/container/functions.hpp>
|
||||||
|
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||||
|
#include <sprout/type_traits/enabler_if.hpp>
|
||||||
|
#include <sprout/algorithm/cxx14/unique_copy.hpp>
|
||||||
|
|
||||||
|
namespace sprout {
|
||||||
|
namespace range {
|
||||||
|
//
|
||||||
|
// unique_copy
|
||||||
|
//
|
||||||
|
template<
|
||||||
|
typename InputRange, typename OutputIterator, typename BinaryPredicate,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
unique_copy(InputRange const& rng, OutputIterator result, BinaryPredicate pred) {
|
||||||
|
return sprout::unique_copy(sprout::begin(rng), sprout::end(rng), result, pred);
|
||||||
|
}
|
||||||
|
template<
|
||||||
|
typename InputRange, typename OutputIterator,
|
||||||
|
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||||
|
>
|
||||||
|
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||||
|
unique_copy(InputRange const& rng, OutputIterator result) {
|
||||||
|
return sprout::unique_copy(sprout::begin(rng), sprout::end(rng), result);
|
||||||
|
}
|
||||||
|
} // namespace range
|
||||||
|
} // namespace sprout
|
||||||
|
|
||||||
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_CXX14_UNIQUE_COPY_HPP
|
|
@ -11,5 +11,6 @@
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/range/algorithm/fixed.hpp>
|
#include <sprout/range/algorithm/fixed.hpp>
|
||||||
#include <sprout/range/algorithm/fit.hpp>
|
#include <sprout/range/algorithm/fit.hpp>
|
||||||
|
#include <sprout/range/algorithm/cxx14.hpp>
|
||||||
|
|
||||||
#endif // #ifndef SPROUT_RANGE_ALGORITHM_MODIFYIING_HPP
|
#endif // #ifndef SPROUT_RANGE_ALGORITHM_MODIFYIING_HPP
|
||||||
|
|
Loading…
Add table
Reference in a new issue