add algorithm copy_while, copy_until

This commit is contained in:
bolero-MURAKAMI 2012-10-13 22:11:32 +09:00
parent f53be1a3d5
commit 9b9956f810
20 changed files with 649 additions and 0 deletions

View file

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

View file

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

View file

@ -20,6 +20,8 @@
#include <sprout/range/algorithm/fit/set_intersection.hpp>
#include <sprout/range/algorithm/fit/set_difference.hpp>
#include <sprout/range/algorithm/fit/set_symmetric_difference.hpp>
#include <sprout/range/algorithm/fit/copy_while.hpp>
#include <sprout/range/algorithm/fit/copy_until.hpp>
#include <sprout/range/algorithm/fit/clamp_range_copy.hpp>
#include <sprout/range/algorithm/fit/swap_element_copy.hpp>

View file

@ -0,0 +1,25 @@
#ifndef SPROUT_RANGE_ALGORITHM_FIT_COPY_UNTIL_HPP
#define SPROUT_RANGE_ALGORITHM_FIT_COPY_UNTIL_HPP
#include <sprout/config.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/algorithm/fit/copy_until.hpp>
namespace sprout {
namespace range {
namespace fit {
//
// copy_until
//
template<typename Input, typename Result, typename Predicate>
inline SPROUT_CONSTEXPR typename sprout::fit::result_of::algorithm<Result>::type
copy_until(Input const& input, Result const& result, Predicate pred) {
return sprout::fit::copy_until(sprout::begin(input), sprout::end(input), result, pred);
}
} // namespace fit
} // namespace range
} // namespace sprout
#endif // #ifndef SPROUT_RANGE_ALGORITHM_FIT_COPY_UNTIL_HPP

View file

@ -0,0 +1,25 @@
#ifndef SPROUT_RANGE_ALGORITHM_FIT_COPY_WHILE_HPP
#define SPROUT_RANGE_ALGORITHM_FIT_COPY_WHILE_HPP
#include <sprout/config.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/algorithm/fit/copy_while.hpp>
namespace sprout {
namespace range {
namespace fit {
//
// copy_while
//
template<typename Input, typename Result, typename Predicate>
inline SPROUT_CONSTEXPR typename sprout::fit::result_of::algorithm<Result>::type
copy_while(Input const& input, Result const& result, Predicate pred) {
return sprout::fit::copy_while(sprout::begin(input), sprout::end(input), result, pred);
}
} // namespace fit
} // namespace range
} // namespace sprout
#endif // #ifndef SPROUT_RANGE_ALGORITHM_FIT_COPY_WHILE_HPP

View file

@ -20,6 +20,8 @@
#include <sprout/range/algorithm/fixed/set_intersection.hpp>
#include <sprout/range/algorithm/fixed/set_difference.hpp>
#include <sprout/range/algorithm/fixed/set_symmetric_difference.hpp>
#include <sprout/range/algorithm/fixed/copy_while.hpp>
#include <sprout/range/algorithm/fixed/copy_until.hpp>
#include <sprout/range/algorithm/fixed/clamp_range_copy.hpp>
#include <sprout/range/algorithm/fixed/swap_element_copy.hpp>

View file

@ -0,0 +1,27 @@
#ifndef SPROUT_RANGE_ALGORITHM_FIXED_COPY_UNTIL_HPP
#define SPROUT_RANGE_ALGORITHM_FIXED_COPY_UNTIL_HPP
#include <sprout/config.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/algorithm/fixed/copy_until.hpp>
namespace sprout {
namespace range {
namespace fixed {
//
// copy_until
//
template<typename Input, typename Result, typename Predicate>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
copy_until(Input const& input, Result const& result, Predicate pred) {
return sprout::fixed::copy_until(sprout::begin(input), sprout::end(input), result);
}
} // namespace fixed
using sprout::range::fixed::copy_until;
} // namespace range
} // namespace sprout
#endif // #ifndef SPROUT_RANGE_ALGORITHM_FIXED_COPY_UNTIL_HPP

View file

@ -0,0 +1,27 @@
#ifndef SPROUT_RANGE_ALGORITHM_FIXED_COPY_WHILE_HPP
#define SPROUT_RANGE_ALGORITHM_FIXED_COPY_WHILE_HPP
#include <sprout/config.hpp>
#include <sprout/container/traits.hpp>
#include <sprout/container/functions.hpp>
#include <sprout/algorithm/fixed/result_of.hpp>
#include <sprout/algorithm/fixed/copy_while.hpp>
namespace sprout {
namespace range {
namespace fixed {
//
// copy_while
//
template<typename Input, typename Result, typename Predicate>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
copy_while(Input const& input, Result const& result, Predicate pred) {
return sprout::fixed::copy_while(sprout::begin(input), sprout::end(input), result);
}
} // namespace fixed
using sprout::range::fixed::copy_while;
} // namespace range
} // namespace sprout
#endif // #ifndef SPROUT_RANGE_ALGORITHM_FIXED_COPY_WHILE_HPP