add algorithm clamp, clamp_range_copy, clamp_range

This commit is contained in:
bolero-MURAKAMI 2012-10-13 21:06:32 +09:00
parent de41f5c880
commit 79ea4f0885
29 changed files with 870 additions and 11 deletions

View file

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

View file

@ -20,6 +20,7 @@
#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/clamp_range_copy.hpp>
#include <sprout/range/algorithm/fit/swap_element_copy.hpp>
#endif // #ifndef SPROUT_RANGE_ALGORITHM_FIT_HPP

View file

@ -0,0 +1,41 @@
#ifndef SPROUT_RANGE_ALGORITHM_FIT_CLAMP_RANGE_COPY_HPP
#define SPROUT_RANGE_ALGORITHM_FIT_CLAMP_RANGE_COPY_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/clamp_range_copy.hpp>
namespace sprout {
namespace range {
namespace fit {
//
// clamp_range_copy
//
template<typename Input, typename Result, typename Compare>
inline SPROUT_CONSTEXPR typename sprout::fit::result_of::algorithm<Result>::type
clamp_range_copy(
Input const& input, Result const& result,
typename sprout::container_traits<Input>::value_type const& low,
typename sprout::container_traits<Input>::value_type const& high,
Compare comp
)
{
return sprout::fit::clamp_range_copy(sprout::begin(input), sprout::end(input), result, low, high, comp);
}
template<typename Input, typename Result>
inline SPROUT_CONSTEXPR typename sprout::fit::result_of::algorithm<Result>::type
clamp_range_copy(
Input const& input, Result const& result,
typename sprout::container_traits<Input>::value_type const& low,
typename sprout::container_traits<Input>::value_type const& high
)
{
return sprout::fit::clamp_range_copy(sprout::begin(input), sprout::end(input), result, low, high);
}
} // namespace fit
} // namespace range
} // namespace sprout
#endif // #ifndef SPROUT_RANGE_ALGORITHM_FIT_CLAMP_RANGE_COPY_HPP

View file

@ -20,6 +20,7 @@
#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/clamp_range_copy.hpp>
#include <sprout/range/algorithm/fixed/swap_element_copy.hpp>
#endif // #ifndef SPROUT_RANGE_ALGORITHM_FIXED_HPP

View file

@ -0,0 +1,43 @@
#ifndef SPROUT_RANGE_ALGORITHM_FIXED_CLAMP_RANGE_COPY_HPP
#define SPROUT_RANGE_ALGORITHM_FIXED_CLAMP_RANGE_COPY_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/clamp_range_copy.hpp>
namespace sprout {
namespace range {
namespace fixed {
//
// clamp_range_copy
//
template<typename Input, typename Result, typename Compare>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
clamp_range_copy(
Input const& input, Result const& result,
typename sprout::container_traits<Input>::value_type const& low,
typename sprout::container_traits<Input>::value_type const& high,
Compare comp
)
{
return sprout::fixed::clamp_range_copy(sprout::begin(input), sprout::end(input), result, low, high, comp);
}
template<typename Input, typename Result>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
clamp_range_copy(
Input const& input, Result const& result,
typename sprout::container_traits<Input>::value_type const& low,
typename sprout::container_traits<Input>::value_type const& high
)
{
return sprout::fixed::clamp_range_copy(sprout::begin(input), sprout::end(input), result, low, high);
}
} // namespace fixed
using sprout::range::fixed::clamp_range_copy;
} // namespace range
} // namespace sprout
#endif // #ifndef SPROUT_RANGE_ALGORITHM_FIXED_CLAMP_RANGE_COPY_HPP