mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-04 14:14:09 +00:00
add c++14 constexpr numeric algorithms
This commit is contained in:
parent
fd608b74e2
commit
f1555cb917
65 changed files with 433 additions and 150 deletions
|
@ -5,8 +5,8 @@
|
|||
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_CXX14_ALGORITHM_REPLACE_COPY_IF_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_REPLACE_COPY_IF_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_REPLACE_COPY_IF_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_REPLACE_COPY_IF_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||
|
@ -20,7 +20,7 @@ namespace sprout {
|
|||
typename InputIterator, typename OutputIterator, typename Predicate, typename T,
|
||||
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CXX14_CONSTEXPR void
|
||||
inline SPROUT_CXX14_CONSTEXPR OutputIterator
|
||||
replace_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred, T const& new_value) {
|
||||
for (; first != last; ++first) {
|
||||
*result++ = (pred(*first) ? new_value : *first);
|
||||
|
@ -29,4 +29,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_REPLACE_COPY_IF_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_REPLACE_COPY_IF_HPP
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue