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 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_CXX14_ALGORITHM_COPY_HPP #ifndef SPROUT_ALGORITHM_CXX14_COPY_HPP
#define SPROUT_CXX14_ALGORITHM_COPY_HPP #define SPROUT_ALGORITHM_CXX14_COPY_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/iterator/type_traits/is_iterator_of.hpp> #include <sprout/iterator/type_traits/is_iterator_of.hpp>
@ -29,4 +29,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_COPY_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_COPY_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_COPY_BACKWARD_HPP #ifndef SPROUT_ALGORITHM_CXX14_COPY_BACKWARD_HPP
#define SPROUT_CXX14_ALGORITHM_COPY_BACKWARD_HPP #define SPROUT_ALGORITHM_CXX14_COPY_BACKWARD_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/iterator/type_traits/is_iterator_of.hpp> #include <sprout/iterator/type_traits/is_iterator_of.hpp>
@ -29,4 +29,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_COPY_BACKWARD_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_COPY_BACKWARD_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_COPY_IF_HPP #ifndef SPROUT_ALGORITHM_CXX14_COPY_IF_HPP
#define SPROUT_CXX14_ALGORITHM_COPY_IF_HPP #define SPROUT_ALGORITHM_CXX14_COPY_IF_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/iterator/type_traits/is_iterator_of.hpp> #include <sprout/iterator/type_traits/is_iterator_of.hpp>
@ -31,4 +31,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_COPY_IF_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_COPY_IF_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_COPY_N_HPP #ifndef SPROUT_ALGORITHM_CXX14_COPY_N_HPP
#define SPROUT_CXX14_ALGORITHM_COPY_N_HPP #define SPROUT_ALGORITHM_CXX14_COPY_N_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/iterator/type_traits/is_iterator_of.hpp> #include <sprout/iterator/type_traits/is_iterator_of.hpp>
@ -29,4 +29,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_COPY_N_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_COPY_N_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_FILL_HPP #ifndef SPROUT_ALGORITHM_CXX14_FILL_HPP
#define SPROUT_CXX14_ALGORITHM_FILL_HPP #define SPROUT_ALGORITHM_CXX14_FILL_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
@ -23,4 +23,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_FILL_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_FILL_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_FILL_N_HPP #ifndef SPROUT_ALGORITHM_CXX14_FILL_N_HPP
#define SPROUT_CXX14_ALGORITHM_FILL_N_HPP #define SPROUT_ALGORITHM_CXX14_FILL_N_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/iterator/type_traits/is_iterator_of.hpp> #include <sprout/iterator/type_traits/is_iterator_of.hpp>
@ -29,4 +29,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_FILL_N_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_FILL_N_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_GENERATE_HPP #ifndef SPROUT_ALGORITHM_CXX14_GENERATE_HPP
#define SPROUT_CXX14_ALGORITHM_GENERATE_HPP #define SPROUT_ALGORITHM_CXX14_GENERATE_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
@ -23,4 +23,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_GENERATE_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_GENERATE_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_GENERATE_N_HPP #ifndef SPROUT_ALGORITHM_CXX14_GENERATE_N_HPP
#define SPROUT_CXX14_ALGORITHM_GENERATE_N_HPP #define SPROUT_ALGORITHM_CXX14_GENERATE_N_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
@ -27,4 +27,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_GENERATE_N_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_GENERATE_N_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_ITER_SWAP_HPP #ifndef SPROUT_ALGORITHM_CXX14_ITER_SWAP_HPP
#define SPROUT_CXX14_ALGORITHM_ITER_SWAP_HPP #define SPROUT_ALGORITHM_CXX14_ITER_SWAP_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/utility/swap.hpp> #include <sprout/utility/swap.hpp>
@ -22,4 +22,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_ITER_SWAP_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_ITER_SWAP_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_MOVE_HPP #ifndef SPROUT_ALGORITHM_CXX14_MOVE_HPP
#define SPROUT_CXX14_ALGORITHM_MOVE_HPP #define SPROUT_ALGORITHM_CXX14_MOVE_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
@ -30,4 +30,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_MOVE_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_MOVE_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_MOVE_BACKWARD_HPP #ifndef SPROUT_ALGORITHM_CXX14_MOVE_BACKWARD_HPP
#define SPROUT_CXX14_ALGORITHM_MOVE_BACKWARD_HPP #define SPROUT_ALGORITHM_CXX14_MOVE_BACKWARD_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
@ -30,4 +30,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_MOVE_BACKWARD_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_MOVE_BACKWARD_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_NTH_ELEMENT_HPP #ifndef SPROUT_ALGORITHM_CXX14_NTH_ELEMENT_HPP
#define SPROUT_CXX14_ALGORITHM_NTH_ELEMENT_HPP #define SPROUT_ALGORITHM_CXX14_NTH_ELEMENT_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
@ -24,4 +24,4 @@ namespace sprout {
nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last, Compare comp); nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last, Compare comp);
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_NTH_ELEMENT_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_NTH_ELEMENT_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_PARTIAL_SORT_HPP #ifndef SPROUT_ALGORITHM_CXX14_PARTIAL_SORT_HPP
#define SPROUT_CXX14_ALGORITHM_PARTIAL_SORT_HPP #define SPROUT_ALGORITHM_CXX14_PARTIAL_SORT_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
@ -24,4 +24,4 @@ namespace sprout {
partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last, Compare comp); partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last, Compare comp);
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_PARTIAL_SORT_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_PARTIAL_SORT_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_PARTIAL_SORT_COPY_HPP #ifndef SPROUT_ALGORITHM_CXX14_PARTIAL_SORT_COPY_HPP
#define SPROUT_CXX14_ALGORITHM_PARTIAL_SORT_COPY_HPP #define SPROUT_ALGORITHM_CXX14_PARTIAL_SORT_COPY_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
@ -24,4 +24,4 @@ namespace sprout {
partial_sort_copy(InputIterator first, InputIterator last, RandomAccessIterator result_first, RandomAccessIterator result_last, Compare comp); partial_sort_copy(InputIterator first, InputIterator last, RandomAccessIterator result_first, RandomAccessIterator result_last, Compare comp);
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_PARTIAL_SORT_COPY_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_PARTIAL_SORT_COPY_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_PARTITION_HPP #ifndef SPROUT_ALGORITHM_CXX14_PARTITION_HPP
#define SPROUT_CXX14_ALGORITHM_PARTITION_HPP #define SPROUT_ALGORITHM_CXX14_PARTITION_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/algorithm/find_if.hpp> #include <sprout/algorithm/find_if.hpp>
@ -31,4 +31,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_PARTITION_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_PARTITION_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_PARTITION_COPY_HPP #ifndef SPROUT_ALGORITHM_CXX14_PARTITION_COPY_HPP
#define SPROUT_CXX14_ALGORITHM_PARTITION_COPY_HPP #define SPROUT_ALGORITHM_CXX14_PARTITION_COPY_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/utility/pair.hpp> #include <sprout/utility/pair.hpp>
@ -29,4 +29,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_PARTITION_COPY_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_PARTITION_COPY_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_RANDOM_SHUFFLE_HPP #ifndef SPROUT_ALGORITHM_CXX14_RANDOM_SHUFFLE_HPP
#define SPROUT_CXX14_ALGORITHM_RANDOM_SHUFFLE_HPP #define SPROUT_ALGORITHM_CXX14_RANDOM_SHUFFLE_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/algorithm/cxx14/iter_swap.hpp> #include <sprout/algorithm/cxx14/iter_swap.hpp>
@ -27,4 +27,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_RANDOM_SHUFFLE_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_RANDOM_SHUFFLE_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_REMOVE_HPP #ifndef SPROUT_ALGORITHM_CXX14_REMOVE_HPP
#define SPROUT_CXX14_ALGORITHM_REMOVE_HPP #define SPROUT_ALGORITHM_CXX14_REMOVE_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/utility/move.hpp> #include <sprout/utility/move.hpp>
@ -28,4 +28,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_REMOVE_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_REMOVE_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_REMOVE_COPY_HPP #ifndef SPROUT_ALGORITHM_CXX14_REMOVE_COPY_HPP
#define SPROUT_CXX14_ALGORITHM_REMOVE_COPY_HPP #define SPROUT_ALGORITHM_CXX14_REMOVE_COPY_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/iterator/type_traits/is_iterator_of.hpp> #include <sprout/iterator/type_traits/is_iterator_of.hpp>
@ -31,4 +31,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_REMOVE_COPY_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_REMOVE_COPY_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_REMOVE_COPY_IF_HPP #ifndef SPROUT_ALGORITHM_CXX14_REMOVE_COPY_IF_HPP
#define SPROUT_CXX14_ALGORITHM_REMOVE_COPY_IF_HPP #define SPROUT_ALGORITHM_CXX14_REMOVE_COPY_IF_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/iterator/type_traits/is_iterator_of.hpp> #include <sprout/iterator/type_traits/is_iterator_of.hpp>
@ -31,4 +31,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_REMOVE_COPY_IF_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_REMOVE_COPY_IF_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_REMOVE_IF_HPP #ifndef SPROUT_ALGORITHM_CXX14_REMOVE_IF_HPP
#define SPROUT_CXX14_ALGORITHM_REMOVE_IF_HPP #define SPROUT_ALGORITHM_CXX14_REMOVE_IF_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/utility/move.hpp> #include <sprout/utility/move.hpp>
@ -28,4 +28,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_REMOVE_IF_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_REMOVE_IF_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_REPLACE_HPP #ifndef SPROUT_ALGORITHM_CXX14_REPLACE_HPP
#define SPROUT_CXX14_ALGORITHM_REPLACE_HPP #define SPROUT_ALGORITHM_CXX14_REPLACE_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
@ -25,4 +25,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_REPLACE_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_REPLACE_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_REPLACE_COPY_HPP #ifndef SPROUT_ALGORITHM_CXX14_REPLACE_COPY_HPP
#define SPROUT_CXX14_ALGORITHM_REPLACE_COPY_HPP #define SPROUT_ALGORITHM_CXX14_REPLACE_COPY_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/iterator/type_traits/is_iterator_of.hpp> #include <sprout/iterator/type_traits/is_iterator_of.hpp>
@ -20,7 +20,7 @@ namespace sprout {
typename InputIterator, typename OutputIterator, typename T, typename InputIterator, typename OutputIterator, typename T,
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler 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) { replace_copy(InputIterator first, InputIterator last, OutputIterator result, T const& old_value, T const& new_value) {
for (; first != last; ++first) { for (; first != last; ++first) {
*result++ = (*first == old_value ? new_value : *first); *result++ = (*first == old_value ? new_value : *first);
@ -29,4 +29,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_REPLACE_COPY_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_REPLACE_COPY_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_REPLACE_COPY_IF_HPP #ifndef SPROUT_ALGORITHM_CXX14_REPLACE_COPY_IF_HPP
#define SPROUT_CXX14_ALGORITHM_REPLACE_COPY_IF_HPP #define SPROUT_ALGORITHM_CXX14_REPLACE_COPY_IF_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/iterator/type_traits/is_iterator_of.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 InputIterator, typename OutputIterator, typename Predicate, typename T,
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler 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) { replace_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred, T const& new_value) {
for (; first != last; ++first) { for (; first != last; ++first) {
*result++ = (pred(*first) ? new_value : *first); *result++ = (pred(*first) ? new_value : *first);
@ -29,4 +29,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_REPLACE_COPY_IF_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_REPLACE_COPY_IF_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_REPLACE_IF_HPP #ifndef SPROUT_ALGORITHM_CXX14_REPLACE_IF_HPP
#define SPROUT_CXX14_ALGORITHM_REPLACE_IF_HPP #define SPROUT_ALGORITHM_CXX14_REPLACE_IF_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
@ -25,4 +25,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_REPLACE_IF_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_REPLACE_IF_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_REVERSE_HPP #ifndef SPROUT_ALGORITHM_CXX14_REVERSE_HPP
#define SPROUT_CXX14_ALGORITHM_REVERSE_HPP #define SPROUT_ALGORITHM_CXX14_REVERSE_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/algorithm/cxx14/iter_swap.hpp> #include <sprout/algorithm/cxx14/iter_swap.hpp>
@ -24,4 +24,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_REVERSE_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_REVERSE_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_REVERSE_COPY_HPP #ifndef SPROUT_ALGORITHM_CXX14_REVERSE_COPY_HPP
#define SPROUT_CXX14_ALGORITHM_REVERSE_COPY_HPP #define SPROUT_ALGORITHM_CXX14_REVERSE_COPY_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/iterator/type_traits/is_iterator_of.hpp> #include <sprout/iterator/type_traits/is_iterator_of.hpp>
@ -29,4 +29,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_REVERSE_COPY_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_REVERSE_COPY_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_ROTATE_HPP #ifndef SPROUT_ALGORITHM_CXX14_ROTATE_HPP
#define SPROUT_CXX14_ALGORITHM_ROTATE_HPP #define SPROUT_ALGORITHM_CXX14_ROTATE_HPP
#include <iterator> #include <iterator>
#include <sprout/config.hpp> #include <sprout/config.hpp>
@ -55,4 +55,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_ROTATE_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_ROTATE_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_ROTATE_COPY_HPP #ifndef SPROUT_ALGORITHM_CXX14_ROTATE_COPY_HPP
#define SPROUT_CXX14_ALGORITHM_ROTATE_COPY_HPP #define SPROUT_ALGORITHM_CXX14_ROTATE_COPY_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/iterator/type_traits/is_iterator_of.hpp> #include <sprout/iterator/type_traits/is_iterator_of.hpp>
@ -27,4 +27,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_ROTATE_COPY_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_ROTATE_COPY_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_SHUFFLE_HPP #ifndef SPROUT_ALGORITHM_CXX14_SHUFFLE_HPP
#define SPROUT_CXX14_ALGORITHM_SHUFFLE_HPP #define SPROUT_ALGORITHM_CXX14_SHUFFLE_HPP
#include <iterator> #include <iterator>
#include <sprout/config.hpp> #include <sprout/config.hpp>
@ -36,4 +36,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_SHUFFLE_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_SHUFFLE_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_SORT_HPP #ifndef SPROUT_ALGORITHM_CXX14_SORT_HPP
#define SPROUT_CXX14_ALGORITHM_SORT_HPP #define SPROUT_ALGORITHM_CXX14_SORT_HPP
#include <iterator> #include <iterator>
#include <sprout/config.hpp> #include <sprout/config.hpp>
@ -353,4 +353,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_SORT_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_SORT_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_STABLE_PARTITION_HPP #ifndef SPROUT_ALGORITHM_CXX14_STABLE_PARTITION_HPP
#define SPROUT_CXX14_ALGORITHM_STABLE_PARTITION_HPP #define SPROUT_ALGORITHM_CXX14_STABLE_PARTITION_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
@ -20,4 +20,4 @@ namespace sprout {
stable_partition(BidirectionalIterator first, BidirectionalIterator last, Predicate pred); stable_partition(BidirectionalIterator first, BidirectionalIterator last, Predicate pred);
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_STABLE_PARTITION_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_STABLE_PARTITION_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_STABLE_SORT_HPP #ifndef SPROUT_ALGORITHM_CXX14_STABLE_SORT_HPP
#define SPROUT_CXX14_ALGORITHM_STABLE_SORT_HPP #define SPROUT_ALGORITHM_CXX14_STABLE_SORT_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
@ -24,4 +24,4 @@ namespace sprout {
stable_sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp); stable_sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp);
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_STABLE_SORT_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_STABLE_SORT_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_SWAP_RANGES_HPP #ifndef SPROUT_ALGORITHM_CXX14_SWAP_RANGES_HPP
#define SPROUT_CXX14_ALGORITHM_SWAP_RANGES_HPP #define SPROUT_ALGORITHM_CXX14_SWAP_RANGES_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/algorithm/cxx14/iter_swap.hpp> #include <sprout/algorithm/cxx14/iter_swap.hpp>
@ -25,4 +25,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_SWAP_RANGES_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_SWAP_RANGES_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_TRANSFORM_HPP #ifndef SPROUT_ALGORITHM_CXX14_TRANSFORM_HPP
#define SPROUT_CXX14_ALGORITHM_TRANSFORM_HPP #define SPROUT_ALGORITHM_CXX14_TRANSFORM_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/iterator/type_traits/is_iterator_of.hpp> #include <sprout/iterator/type_traits/is_iterator_of.hpp>
@ -40,4 +40,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_TRANSFORM_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_TRANSFORM_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_UNIQUE_HPP #ifndef SPROUT_ALGORITHM_CXX14_UNIQUE_HPP
#define SPROUT_CXX14_ALGORITHM_UNIQUE_HPP #define SPROUT_ALGORITHM_CXX14_UNIQUE_HPP
#include <iterator> #include <iterator>
#include <sprout/config.hpp> #include <sprout/config.hpp>
@ -52,4 +52,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_UNIQUE_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_UNIQUE_HPP

View file

@ -5,8 +5,8 @@
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_CXX14_ALGORITHM_UNIQUE_COPY_HPP #ifndef SPROUT_ALGORITHM_CXX14_UNIQUE_COPY_HPP
#define SPROUT_CXX14_ALGORITHM_UNIQUE_COPY_HPP #define SPROUT_ALGORITHM_CXX14_UNIQUE_COPY_HPP
#include <iterator> #include <iterator>
#include <sprout/config.hpp> #include <sprout/config.hpp>
@ -58,4 +58,4 @@ namespace sprout {
} }
} // namespace sprout } // namespace sprout
#endif // #ifndef SPROUT_CXX14_ALGORITHM_UNIQUE_COPY_HPP #endif // #ifndef SPROUT_ALGORITHM_CXX14_UNIQUE_COPY_HPP

View file

@ -9,8 +9,8 @@
#define SPROUT_NUMERIC_CXX14_HPP #define SPROUT_NUMERIC_CXX14_HPP
#include <sprout/config.hpp> #include <sprout/config.hpp>
//#include <sprout/numeric/cxx14/partial_sum.hpp> #include <sprout/numeric/cxx14/partial_sum.hpp>
//#include <sprout/numeric/cxx14/adjacent_difference.hpp> #include <sprout/numeric/cxx14/adjacent_difference.hpp>
//#include <sprout/numeric/cxx14/iota.hpp> #include <sprout/numeric/cxx14/iota.hpp>
#endif // #ifndef SPROUT_NUMERIC_CXX14_HPP #endif // #ifndef SPROUT_NUMERIC_CXX14_HPP

View file

@ -0,0 +1,54 @@
/*=============================================================================
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_NUMERIC_CXX14_ADJACENT_DIFFERENCE_HPP
#define SPROUT_NUMERIC_CXX14_ADJACENT_DIFFERENCE_HPP
#include <iterator>
#include <sprout/config.hpp>
#include <sprout/utility/move.hpp>
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
//
// 26.7.5 Adjacent difference
//
template<
typename InputIterator, typename OutputIterator, typename BinaryOperation,
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
>
inline SPROUT_CXX14_CONSTEXPR OutputIterator
adjacent_difference(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op) {
typedef typename std::iterator_traits<InputIterator>::value_type value_type;
if (first == last) {
return result;
}
value_type acc = *first;
*result = acc;
while (++first != last) {
value_type val = *first;
*++result = binary_op(val, acc);
acc = sprout::move(val);
}
return ++result;
}
template<
typename InputIterator, typename OutputIterator,
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
>
inline SPROUT_CXX14_CONSTEXPR OutputIterator
adjacent_difference(InputIterator first, InputIterator last, OutputIterator result) {
return sprout::adjacent_difference(
first, last, result,
NS_SSCRISK_CEL_OR_SPROUT::minus<typename std::iterator_traits<InputIterator>::value_type>()
);
}
} // namespace sprout
#endif // #ifndef SPROUT_NUMERIC_CXX14_ADJACENT_DIFFERENCE_HPP

View file

@ -0,0 +1,27 @@
/*=============================================================================
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_NUMERIC_CXX14_IOTA_HPP
#define SPROUT_NUMERIC_CXX14_IOTA_HPP
#include <sprout/config.hpp>
namespace sprout {
//
// 26.7.6 Iota
//
template<typename ForwardIterator, typename T>
inline SPROUT_CXX14_CONSTEXPR void
iota(ForwardIterator first, ForwardIterator last, T value) {
while (first != last) {
*first++ = value;
++value;
}
}
} // namespace sprout
#endif // #ifndef SPROUT_NUMERIC_CXX14_IOTA_HPP

View file

@ -0,0 +1,52 @@
/*=============================================================================
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_NUMERIC_CXX14_PARTIAL_SUM_HPP
#define SPROUT_NUMERIC_CXX14_PARTIAL_SUM_HPP
#include <iterator>
#include <sprout/config.hpp>
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
#include <sprout/type_traits/enabler_if.hpp>
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT
namespace sprout {
//
// 26.7.4 Partial sum
//
template<
typename InputIterator, typename OutputIterator, typename BinaryOperation,
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
>
inline SPROUT_CXX14_CONSTEXPR OutputIterator
partial_sum(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op) {
typedef typename std::iterator_traits<InputIterator>::value_type value_type;
if (first == last) {
return result;
}
value_type sum = *first;
*result = sum;
while (++first != last) {
sum = binary_op(sum, *first);
*++result = sum;
}
return ++result;
}
template<
typename InputIterator, typename OutputIterator,
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
>
inline SPROUT_CXX14_CONSTEXPR OutputIterator
partial_sum(InputIterator first, InputIterator last, OutputIterator result) {
return sprout::partial_sum(
first, last, result,
NS_SSCRISK_CEL_OR_SPROUT::plus<typename std::iterator_traits<InputIterator>::value_type>()
);
}
} // namespace sprout
#endif // #ifndef SPROUT_NUMERIC_CXX14_PARTIAL_SUM_HPP

View file

@ -11,6 +11,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/traits.hpp> #include <sprout/container/traits.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/algorithm/fixed/clamp_range_copy.hpp> #include <sprout/algorithm/fixed/clamp_range_copy.hpp>
@ -20,7 +22,10 @@ namespace sprout {
// //
// clamp_range_copy // clamp_range_copy
// //
template<typename InputRange, typename Result, typename Compare> template<
typename InputRange, typename Result, typename Compare,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
clamp_range_copy( clamp_range_copy(
InputRange const& rng, Result const& result, InputRange const& rng, Result const& result,
@ -31,7 +36,10 @@ namespace sprout {
{ {
return sprout::fixed::clamp_range_copy(sprout::begin(rng), sprout::end(rng), result, low, high, comp); return sprout::fixed::clamp_range_copy(sprout::begin(rng), sprout::end(rng), result, low, high, comp);
} }
template<typename InputRange, typename Result> template<
typename InputRange, typename Result,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
clamp_range_copy( clamp_range_copy(
InputRange const& rng, Result const& result, InputRange const& rng, Result const& result,

View file

@ -10,6 +10,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/algorithm/fixed/copy.hpp> #include <sprout/algorithm/fixed/copy.hpp>
@ -19,7 +21,10 @@ namespace sprout {
// //
// copy // copy
// //
template<typename InputRange, typename Result> template<
typename InputRange, typename Result,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
copy(InputRange const& rng, Result const& result) { copy(InputRange const& rng, Result const& result) {
return sprout::fixed::copy(sprout::begin(rng), sprout::end(rng), result); return sprout::fixed::copy(sprout::begin(rng), sprout::end(rng), result);

View file

@ -10,6 +10,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/algorithm/fixed/copy_backward.hpp> #include <sprout/algorithm/fixed/copy_backward.hpp>
@ -19,7 +21,10 @@ namespace sprout {
// //
// copy_backward // copy_backward
// //
template<typename BidirectionalRange, typename Result> template<
typename BidirectionalRange, typename Result,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
copy_backward(BidirectionalRange const& rng, Result const& result) { copy_backward(BidirectionalRange const& rng, Result const& result) {
return sprout::fixed::copy_backward(sprout::begin(rng), sprout::end(rng), result); return sprout::fixed::copy_backward(sprout::begin(rng), sprout::end(rng), result);

View file

@ -10,6 +10,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/algorithm/fixed/copy_if.hpp> #include <sprout/algorithm/fixed/copy_if.hpp>
@ -19,7 +21,10 @@ namespace sprout {
// //
// copy_if // copy_if
// //
template<typename InputRange, typename Result, typename Predicate> template<
typename InputRange, typename Result, typename Predicate,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
copy_if(InputRange const& rng, Result const& result, Predicate pred) { copy_if(InputRange const& rng, Result const& result, Predicate pred) {
return sprout::fixed::copy_if(sprout::begin(rng), sprout::end(rng), result, pred); return sprout::fixed::copy_if(sprout::begin(rng), sprout::end(rng), result, pred);

View file

@ -10,6 +10,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/algorithm/fixed/copy_until.hpp> #include <sprout/algorithm/fixed/copy_until.hpp>
@ -19,7 +21,10 @@ namespace sprout {
// //
// copy_until // copy_until
// //
template<typename InputRange, typename Result, typename Predicate> template<
typename InputRange, typename Result, typename Predicate,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
copy_until(InputRange const& rng, Result const& result, Predicate pred) { copy_until(InputRange const& rng, Result const& result, Predicate pred) {
return sprout::fixed::copy_until(sprout::begin(rng), sprout::end(rng), result, pred); return sprout::fixed::copy_until(sprout::begin(rng), sprout::end(rng), result, pred);

View file

@ -10,6 +10,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/algorithm/fixed/copy_while.hpp> #include <sprout/algorithm/fixed/copy_while.hpp>
@ -19,7 +21,10 @@ namespace sprout {
// //
// copy_while // copy_while
// //
template<typename InputRange, typename Result, typename Predicate> template<
typename InputRange, typename Result, typename Predicate,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
copy_while(InputRange const& rng, Result const& result, Predicate pred) { copy_while(InputRange const& rng, Result const& result, Predicate pred) {
return sprout::fixed::copy_while(sprout::begin(rng), sprout::end(rng), result, pred); return sprout::fixed::copy_while(sprout::begin(rng), sprout::end(rng), result, pred);

View file

@ -10,6 +10,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/algorithm/fixed/merge.hpp> #include <sprout/algorithm/fixed/merge.hpp>
@ -19,12 +21,18 @@ namespace sprout {
// //
// merge // merge
// //
template<typename InputRange1, typename InputRange2, typename Result, typename Compare> template<
typename InputRange1, typename InputRange2, typename Result, typename Compare,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
merge(InputRange1 const& rng1, InputRange2 const& rng2, Result const& result, Compare comp) { merge(InputRange1 const& rng1, InputRange2 const& rng2, Result const& result, Compare comp) {
return sprout::fixed::merge(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result, comp); return sprout::fixed::merge(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result, comp);
} }
template<typename InputRange1, typename InputRange2, typename Result> template<
typename InputRange1, typename InputRange2, typename Result,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
merge(InputRange1 const& rng1, InputRange2 const& rng2, Result const& result) { merge(InputRange1 const& rng1, InputRange2 const& rng2, Result const& result) {
return sprout::fixed::merge(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result); return sprout::fixed::merge(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result);

View file

@ -10,6 +10,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/algorithm/fixed/partition_copy.hpp> #include <sprout/algorithm/fixed/partition_copy.hpp>
@ -19,7 +21,10 @@ namespace sprout {
// //
// partition_copy // partition_copy
// //
template<typename InputRange, typename Result, typename Predicate> template<
typename InputRange, typename Result, typename Predicate,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
partition_copy(InputRange const& rng, Result const& result, Predicate pred) { partition_copy(InputRange const& rng, Result const& result, Predicate pred) {
return sprout::fixed::partition_copy(sprout::begin(rng), sprout::end(rng), result, pred); return sprout::fixed::partition_copy(sprout::begin(rng), sprout::end(rng), result, pred);

View file

@ -10,6 +10,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/algorithm/fixed/remove_copy.hpp> #include <sprout/algorithm/fixed/remove_copy.hpp>
@ -19,7 +21,10 @@ namespace sprout {
// //
// remove_copy // remove_copy
// //
template<typename InputRange, typename Result, typename T> template<
typename InputRange, typename Result, typename T,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
remove_copy(InputRange const& rng, Result const& result, T const& value) { remove_copy(InputRange const& rng, Result const& result, T const& value) {
return sprout::fixed::remove_copy(sprout::begin(rng), sprout::end(rng), result, value); return sprout::fixed::remove_copy(sprout::begin(rng), sprout::end(rng), result, value);

View file

@ -10,6 +10,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/algorithm/fixed/remove_copy_if.hpp> #include <sprout/algorithm/fixed/remove_copy_if.hpp>
@ -19,7 +21,10 @@ namespace sprout {
// //
// remove_copy_if // remove_copy_if
// //
template<typename InputRange, typename Result, typename Predicate> template<
typename InputRange, typename Result, typename Predicate,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
remove_copy_if(InputRange const& rng, Result const& result, Predicate pred) { remove_copy_if(InputRange const& rng, Result const& result, Predicate pred) {
return sprout::fixed::remove_copy_if(sprout::begin(rng), sprout::end(rng), result, pred); return sprout::fixed::remove_copy_if(sprout::begin(rng), sprout::end(rng), result, pred);

View file

@ -10,6 +10,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/algorithm/fixed/replace_copy.hpp> #include <sprout/algorithm/fixed/replace_copy.hpp>
@ -19,7 +21,10 @@ namespace sprout {
// //
// replace_copy // replace_copy
// //
template<typename InputRange, typename Result, typename T> template<
typename InputRange, typename Result, typename T,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
replace_copy(InputRange const& rng, Result const& result, T const& old_value, T const& new_value) { replace_copy(InputRange const& rng, Result const& result, T const& old_value, T const& new_value) {
return sprout::fixed::replace_copy(sprout::begin(rng), sprout::end(rng), result, old_value, new_value); return sprout::fixed::replace_copy(sprout::begin(rng), sprout::end(rng), result, old_value, new_value);

View file

@ -10,6 +10,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/algorithm/fixed/replace_copy_if.hpp> #include <sprout/algorithm/fixed/replace_copy_if.hpp>
@ -19,7 +21,10 @@ namespace sprout {
// //
// replace_copy_if // replace_copy_if
// //
template<typename InputRange, typename Result, typename T, typename Predicate> template<
typename InputRange, typename Result, typename T, typename Predicate,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
replace_copy_if(InputRange const& rng, Result const& result, Predicate pred, T const& new_value) { replace_copy_if(InputRange const& rng, Result const& result, Predicate pred, T const& new_value) {
return sprout::fixed::replace_copy_if(sprout::begin(rng), sprout::end(rng), result, pred, new_value); return sprout::fixed::replace_copy_if(sprout::begin(rng), sprout::end(rng), result, pred, new_value);

View file

@ -10,6 +10,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/algorithm/fixed/reverse_copy.hpp> #include <sprout/algorithm/fixed/reverse_copy.hpp>
@ -19,7 +21,10 @@ namespace sprout {
// //
// reverse_copy // reverse_copy
// //
template<typename BidirectionalRange, typename Result> template<
typename BidirectionalRange, typename Result,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
reverse_copy(BidirectionalRange const& rng, Result const& result) { reverse_copy(BidirectionalRange const& rng, Result const& result) {
return sprout::fixed::reverse_copy(sprout::begin(rng), sprout::end(rng), result); return sprout::fixed::reverse_copy(sprout::begin(rng), sprout::end(rng), result);

View file

@ -11,6 +11,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/traits.hpp> #include <sprout/container/traits.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/algorithm/fixed/rotate_copy.hpp> #include <sprout/algorithm/fixed/rotate_copy.hpp>
@ -20,7 +22,10 @@ namespace sprout {
// //
// rotate_copy // rotate_copy
// //
template<typename ForwardRange, typename Result> template<
typename ForwardRange, typename Result,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
rotate_copy( rotate_copy(
ForwardRange const& rng, typename sprout::container_traits<ForwardRange>::const_iterator middle, ForwardRange const& rng, typename sprout::container_traits<ForwardRange>::const_iterator middle,

View file

@ -10,6 +10,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/algorithm/fixed/set_difference.hpp> #include <sprout/algorithm/fixed/set_difference.hpp>
@ -19,12 +21,18 @@ namespace sprout {
// //
// set_difference // set_difference
// //
template<typename InputRange1, typename InputRange2, typename Result, typename Compare> template<
typename InputRange1, typename InputRange2, typename Result, typename Compare,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
set_difference(InputRange1 const& rng1, InputRange2 const& rng2, Result const& result, Compare comp) { set_difference(InputRange1 const& rng1, InputRange2 const& rng2, Result const& result, Compare comp) {
return sprout::fixed::set_difference(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result, comp); return sprout::fixed::set_difference(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result, comp);
} }
template<typename InputRange1, typename InputRange2, typename Result> template<
typename InputRange1, typename InputRange2, typename Result,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
set_difference(InputRange1 const& rng1, InputRange2 const& rng2, Result const& result) { set_difference(InputRange1 const& rng1, InputRange2 const& rng2, Result const& result) {
return sprout::fixed::set_difference(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result); return sprout::fixed::set_difference(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result);

View file

@ -10,6 +10,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/algorithm/fixed/set_intersection.hpp> #include <sprout/algorithm/fixed/set_intersection.hpp>
@ -19,12 +21,18 @@ namespace sprout {
// //
// set_intersection // set_intersection
// //
template<typename InputRange1, typename InputRange2, typename Result, typename Compare> template<
typename InputRange1, typename InputRange2, typename Result, typename Compare,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
set_intersection(InputRange1 const& rng1, InputRange2 const& rng2, Result const& result, Compare comp) { set_intersection(InputRange1 const& rng1, InputRange2 const& rng2, Result const& result, Compare comp) {
return sprout::fixed::set_intersection(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result, comp); return sprout::fixed::set_intersection(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result, comp);
} }
template<typename InputRange1, typename InputRange2, typename Result> template<
typename InputRange1, typename InputRange2, typename Result,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
set_intersection(InputRange1 const& rng1, InputRange2 const& rng2, Result const& result) { set_intersection(InputRange1 const& rng1, InputRange2 const& rng2, Result const& result) {
return sprout::fixed::set_intersection(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result); return sprout::fixed::set_intersection(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result);

View file

@ -10,6 +10,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/algorithm/fixed/set_symmetric_difference.hpp> #include <sprout/algorithm/fixed/set_symmetric_difference.hpp>
@ -19,12 +21,18 @@ namespace sprout {
// //
// set_symmetric_difference // set_symmetric_difference
// //
template<typename InputRange1, typename InputRange2, typename Result, typename Compare> template<
typename InputRange1, typename InputRange2, typename Result, typename Compare,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
set_symmetric_difference(InputRange1 const& rng1, InputRange2 const& rng2, Result const& result, Compare comp) { set_symmetric_difference(InputRange1 const& rng1, InputRange2 const& rng2, Result const& result, Compare comp) {
return sprout::fixed::set_symmetric_difference(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result, comp); return sprout::fixed::set_symmetric_difference(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result, comp);
} }
template<typename InputRange1, typename InputRange2, typename Result> template<
typename InputRange1, typename InputRange2, typename Result,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
set_symmetric_difference(InputRange1 const& rng1, InputRange2 const& rng2, Result const& result) { set_symmetric_difference(InputRange1 const& rng1, InputRange2 const& rng2, Result const& result) {
return sprout::fixed::set_symmetric_difference(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result); return sprout::fixed::set_symmetric_difference(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result);

View file

@ -10,6 +10,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/algorithm/fixed/set_union.hpp> #include <sprout/algorithm/fixed/set_union.hpp>
@ -19,12 +21,18 @@ namespace sprout {
// //
// set_union // set_union
// //
template<typename InputRange1, typename InputRange2, typename Result, typename Compare> template<
typename InputRange1, typename InputRange2, typename Result, typename Compare,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
set_union(InputRange1 const& rng1, InputRange2 const& rng2, Result const& result, Compare comp) { set_union(InputRange1 const& rng1, InputRange2 const& rng2, Result const& result, Compare comp) {
return sprout::fixed::set_union(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result, comp); return sprout::fixed::set_union(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result, comp);
} }
template<typename InputRange1, typename InputRange2, typename Result> template<
typename InputRange1, typename InputRange2, typename Result,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
set_union(InputRange1 const& rng1, InputRange2 const& rng2, Result const& result) { set_union(InputRange1 const& rng1, InputRange2 const& rng2, Result const& result) {
return sprout::fixed::set_union(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result); return sprout::fixed::set_union(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), sprout::end(rng2), result);

View file

@ -10,6 +10,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/algorithm/fixed/stable_partition_copy.hpp> #include <sprout/algorithm/fixed/stable_partition_copy.hpp>
@ -19,7 +21,10 @@ namespace sprout {
// //
// stable_partition_copy // stable_partition_copy
// //
template<typename BidirectionalRange, typename Result, typename Predicate> template<
typename BidirectionalRange, typename Result, typename Predicate,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
stable_partition_copy(BidirectionalRange const& rng, Result const& result, Predicate pred) { stable_partition_copy(BidirectionalRange const& rng, Result const& result, Predicate pred) {
return sprout::fixed::stable_partition_copy(sprout::begin(rng), sprout::end(rng), result, pred); return sprout::fixed::stable_partition_copy(sprout::begin(rng), sprout::end(rng), result, pred);

View file

@ -11,6 +11,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/traits.hpp> #include <sprout/container/traits.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/algorithm/fixed/swap_element_copy.hpp> #include <sprout/algorithm/fixed/swap_element_copy.hpp>
@ -20,7 +22,10 @@ namespace sprout {
// //
// swap_element_copy // swap_element_copy
// //
template<typename ForwardRange, typename Result> template<
typename ForwardRange, typename Result,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
swap_element_copy( swap_element_copy(
ForwardRange const& rng, Result const& result, ForwardRange const& rng, Result const& result,

View file

@ -10,6 +10,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/algorithm/transform.hpp> #include <sprout/algorithm/transform.hpp>
@ -19,12 +21,18 @@ namespace sprout {
// //
// transform // transform
// //
template<typename InputRange, typename Result, typename UnaryOperation> template<
typename InputRange, typename Result, typename UnaryOperation,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
transform(InputRange const& rng, Result const& result, UnaryOperation op) { transform(InputRange const& rng, Result const& result, UnaryOperation op) {
return sprout::fixed::transform(sprout::begin(rng), sprout::end(rng), result, op); return sprout::fixed::transform(sprout::begin(rng), sprout::end(rng), result, op);
} }
template<typename InputRange1, typename InputRange2, typename Result, typename BinaryOperation> template<
typename InputRange1, typename InputRange2, typename Result, typename BinaryOperation,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
transform(InputRange1 const& rng1, InputRange2 const& rng2, Result const& result, BinaryOperation op) { transform(InputRange1 const& rng1, InputRange2 const& rng2, Result const& result, BinaryOperation op) {
return sprout::fixed::transform(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), result, op); return sprout::fixed::transform(sprout::begin(rng1), sprout::end(rng1), sprout::begin(rng2), result, op);

View file

@ -10,6 +10,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/algorithm/fixed/unique_copy.hpp> #include <sprout/algorithm/fixed/unique_copy.hpp>
@ -19,12 +21,18 @@ namespace sprout {
// //
// unique_copy // unique_copy
// //
template<typename InputRange, typename Result, typename BinaryPredicate> template<
typename InputRange, typename Result, typename BinaryPredicate,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
unique_copy(InputRange const& rng, Result const& result, BinaryPredicate pred) { unique_copy(InputRange const& rng, Result const& result, BinaryPredicate pred) {
return sprout::fixed::unique_copy(sprout::begin(rng), sprout::end(rng), result, pred); return sprout::fixed::unique_copy(sprout::begin(rng), sprout::end(rng), result, pred);
} }
template<typename InputRange, typename Result> template<
typename InputRange, typename Result,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
unique_copy(InputRange const& rng, Result const& result) { unique_copy(InputRange const& rng, Result const& result) {
return sprout::fixed::unique_copy(sprout::begin(rng), sprout::end(rng), result); return sprout::fixed::unique_copy(sprout::begin(rng), sprout::end(rng), result);

View file

@ -11,6 +11,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/traits.hpp> #include <sprout/container/traits.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/numeric/fixed/adjacent_difference.hpp> #include <sprout/numeric/fixed/adjacent_difference.hpp>
@ -20,12 +22,18 @@ namespace sprout {
// //
// adjacent_difference // adjacent_difference
// //
template<typename InputRange, typename Result> template<
typename InputRange, typename Result,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
adjacent_difference(InputRange const& rng, Result const& result) { adjacent_difference(InputRange const& rng, Result const& result) {
return sprout::fixed::adjacent_difference(sprout::begin(rng), sprout::end(rng), result); return sprout::fixed::adjacent_difference(sprout::begin(rng), sprout::end(rng), result);
} }
template<typename InputRange, typename Result, typename BinaryOperation> template<
typename InputRange, typename Result, typename BinaryOperation,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
adjacent_difference(InputRange const& rng, Result const& result, BinaryOperation binary_op) { adjacent_difference(InputRange const& rng, Result const& result, BinaryOperation binary_op) {
return sprout::fixed::adjacent_difference(sprout::begin(rng), sprout::end(rng), result, binary_op); return sprout::fixed::adjacent_difference(sprout::begin(rng), sprout::end(rng), result, binary_op);

View file

@ -11,6 +11,8 @@
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/container/traits.hpp> #include <sprout/container/traits.hpp>
#include <sprout/container/functions.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/fixed/results.hpp> #include <sprout/algorithm/fixed/results.hpp>
#include <sprout/numeric/fixed/partial_sum.hpp> #include <sprout/numeric/fixed/partial_sum.hpp>
@ -20,12 +22,18 @@ namespace sprout {
// //
// partial_sum // partial_sum
// //
template<typename InputRange, typename Result> template<
typename InputRange, typename Result,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
partial_sum(InputRange const& rng, Result const& result) { partial_sum(InputRange const& rng, Result const& result) {
return sprout::fixed::partial_sum(sprout::begin(rng), sprout::end(rng), result); return sprout::fixed::partial_sum(sprout::begin(rng), sprout::end(rng), result);
} }
template<typename InputRange, typename Result, typename BinaryOperation> template<
typename InputRange, typename Result, typename BinaryOperation,
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type inline SPROUT_CONSTEXPR typename sprout::fixed::results::algorithm<Result>::type
partial_sum(InputRange const& rng, Result const& result, BinaryOperation binary_op) { partial_sum(InputRange const& rng, Result const& result, BinaryOperation binary_op) {
return sprout::fixed::partial_sum(sprout::begin(rng), sprout::end(rng), result, binary_op); return sprout::fixed::partial_sum(sprout::begin(rng), sprout::end(rng), result, binary_op);