add c++14 constexpr numeric algorithms

This commit is contained in:
bolero-MURAKAMI 2014-04-05 18:31:09 +09:00
parent fd608b74e2
commit f1555cb917
65 changed files with 433 additions and 150 deletions

View file

@ -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_HPP
#define SPROUT_CXX14_ALGORITHM_REPLACE_COPY_HPP
#ifndef SPROUT_ALGORITHM_CXX14_REPLACE_COPY_HPP
#define SPROUT_ALGORITHM_CXX14_REPLACE_COPY_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 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(InputIterator first, InputIterator last, OutputIterator result, T const& old_value, T const& new_value) {
for (; first != last; ++first) {
*result++ = (*first == old_value ? new_value : *first);
@ -29,4 +29,4 @@ namespace sprout {
}
} // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_REPLACE_COPY_HPP
#endif // #ifndef SPROUT_ALGORITHM_CXX14_REPLACE_COPY_HPP