mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-06-07 00:51:45 +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_COPY_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_COPY_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_COPY_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_COPY_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||
|
@ -29,4 +29,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_COPY_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_COPY_HPP
|
||||
|
|
|
@ -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_COPY_BACKWARD_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_COPY_BACKWARD_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_COPY_BACKWARD_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_COPY_BACKWARD_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||
|
@ -29,4 +29,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_COPY_BACKWARD_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_COPY_BACKWARD_HPP
|
||||
|
|
|
@ -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_COPY_IF_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_COPY_IF_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_COPY_IF_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_COPY_IF_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||
|
@ -31,4 +31,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_COPY_IF_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_COPY_IF_HPP
|
||||
|
|
|
@ -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_COPY_N_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_COPY_N_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_COPY_N_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_COPY_N_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||
|
@ -29,4 +29,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_COPY_N_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_COPY_N_HPP
|
||||
|
|
|
@ -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_FILL_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_FILL_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_FILL_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_FILL_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
|
@ -23,4 +23,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_FILL_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_FILL_HPP
|
||||
|
|
|
@ -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_FILL_N_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_FILL_N_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_FILL_N_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_FILL_N_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||
|
@ -29,4 +29,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_FILL_N_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_FILL_N_HPP
|
||||
|
|
|
@ -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_GENERATE_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_GENERATE_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_GENERATE_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_GENERATE_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
|
@ -23,4 +23,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_GENERATE_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_GENERATE_HPP
|
||||
|
|
|
@ -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_GENERATE_N_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_GENERATE_N_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_GENERATE_N_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_GENERATE_N_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
|
@ -27,4 +27,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_GENERATE_N_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_GENERATE_N_HPP
|
||||
|
|
|
@ -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_ITER_SWAP_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_ITER_SWAP_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_ITER_SWAP_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_ITER_SWAP_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/swap.hpp>
|
||||
|
@ -22,4 +22,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_ITER_SWAP_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_ITER_SWAP_HPP
|
||||
|
|
|
@ -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_MOVE_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_MOVE_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_MOVE_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_MOVE_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/type_traits/enabler_if.hpp>
|
||||
|
@ -30,4 +30,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_MOVE_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_MOVE_HPP
|
||||
|
|
|
@ -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_MOVE_BACKWARD_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_MOVE_BACKWARD_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_MOVE_BACKWARD_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_MOVE_BACKWARD_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/type_traits/enabler_if.hpp>
|
||||
|
@ -30,4 +30,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_MOVE_BACKWARD_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_MOVE_BACKWARD_HPP
|
||||
|
|
|
@ -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_NTH_ELEMENT_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_NTH_ELEMENT_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_NTH_ELEMENT_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_NTH_ELEMENT_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
|
@ -24,4 +24,4 @@ namespace sprout {
|
|||
nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last, Compare comp);
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_NTH_ELEMENT_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_NTH_ELEMENT_HPP
|
||||
|
|
|
@ -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_PARTIAL_SORT_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_PARTIAL_SORT_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_PARTIAL_SORT_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_PARTIAL_SORT_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
|
@ -24,4 +24,4 @@ namespace sprout {
|
|||
partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last, Compare comp);
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_PARTIAL_SORT_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_PARTIAL_SORT_HPP
|
||||
|
|
|
@ -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_PARTIAL_SORT_COPY_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_PARTIAL_SORT_COPY_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_PARTIAL_SORT_COPY_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_PARTIAL_SORT_COPY_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);
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_PARTIAL_SORT_COPY_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_PARTIAL_SORT_COPY_HPP
|
||||
|
|
|
@ -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_PARTITION_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_PARTITION_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_PARTITION_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_PARTITION_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/algorithm/find_if.hpp>
|
||||
|
@ -31,4 +31,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_PARTITION_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_PARTITION_HPP
|
||||
|
|
|
@ -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_PARTITION_COPY_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_PARTITION_COPY_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_PARTITION_COPY_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_PARTITION_COPY_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/pair.hpp>
|
||||
|
@ -29,4 +29,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_PARTITION_COPY_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_PARTITION_COPY_HPP
|
||||
|
|
|
@ -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_RANDOM_SHUFFLE_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_RANDOM_SHUFFLE_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_RANDOM_SHUFFLE_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_RANDOM_SHUFFLE_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/algorithm/cxx14/iter_swap.hpp>
|
||||
|
@ -27,4 +27,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_RANDOM_SHUFFLE_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_RANDOM_SHUFFLE_HPP
|
||||
|
|
|
@ -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_REMOVE_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_REMOVE_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_REMOVE_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_REMOVE_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/move.hpp>
|
||||
|
@ -28,4 +28,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_REMOVE_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_REMOVE_HPP
|
||||
|
|
|
@ -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_REMOVE_COPY_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_REMOVE_COPY_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_REMOVE_COPY_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_REMOVE_COPY_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||
|
@ -31,4 +31,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_REMOVE_COPY_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_REMOVE_COPY_HPP
|
||||
|
|
|
@ -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_REMOVE_COPY_IF_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_REMOVE_COPY_IF_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_REMOVE_COPY_IF_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_REMOVE_COPY_IF_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||
|
@ -31,4 +31,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_REMOVE_COPY_IF_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_REMOVE_COPY_IF_HPP
|
||||
|
|
|
@ -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_REMOVE_IF_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_REMOVE_IF_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_REMOVE_IF_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_REMOVE_IF_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/utility/move.hpp>
|
||||
|
@ -28,4 +28,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_REMOVE_IF_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_REMOVE_IF_HPP
|
||||
|
|
|
@ -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_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_REPLACE_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_REPLACE_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_REPLACE_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
|
@ -25,4 +25,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_REPLACE_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_REPLACE_HPP
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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_IF_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_REPLACE_IF_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_REPLACE_IF_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_REPLACE_IF_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
|
@ -25,4 +25,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_REPLACE_IF_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_REPLACE_IF_HPP
|
||||
|
|
|
@ -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_REVERSE_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_REVERSE_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_REVERSE_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_REVERSE_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/algorithm/cxx14/iter_swap.hpp>
|
||||
|
@ -24,4 +24,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_REVERSE_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_REVERSE_HPP
|
||||
|
|
|
@ -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_REVERSE_COPY_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_REVERSE_COPY_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_REVERSE_COPY_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_REVERSE_COPY_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||
|
@ -29,4 +29,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_REVERSE_COPY_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_REVERSE_COPY_HPP
|
||||
|
|
|
@ -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_ROTATE_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_ROTATE_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_ROTATE_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_ROTATE_HPP
|
||||
|
||||
#include <iterator>
|
||||
#include <sprout/config.hpp>
|
||||
|
@ -55,4 +55,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_ROTATE_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_ROTATE_HPP
|
||||
|
|
|
@ -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_ROTATE_COPY_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_ROTATE_COPY_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_ROTATE_COPY_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_ROTATE_COPY_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||
|
@ -27,4 +27,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_ROTATE_COPY_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_ROTATE_COPY_HPP
|
||||
|
|
|
@ -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_SHUFFLE_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_SHUFFLE_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_SHUFFLE_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_SHUFFLE_HPP
|
||||
|
||||
#include <iterator>
|
||||
#include <sprout/config.hpp>
|
||||
|
@ -36,4 +36,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_SHUFFLE_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_SHUFFLE_HPP
|
||||
|
|
|
@ -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_SORT_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_SORT_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_SORT_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_SORT_HPP
|
||||
|
||||
#include <iterator>
|
||||
#include <sprout/config.hpp>
|
||||
|
@ -353,4 +353,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_SORT_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_SORT_HPP
|
||||
|
|
|
@ -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_STABLE_PARTITION_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_STABLE_PARTITION_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_STABLE_PARTITION_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_STABLE_PARTITION_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
|
@ -20,4 +20,4 @@ namespace sprout {
|
|||
stable_partition(BidirectionalIterator first, BidirectionalIterator last, Predicate pred);
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_STABLE_PARTITION_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_STABLE_PARTITION_HPP
|
||||
|
|
|
@ -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_STABLE_SORT_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_STABLE_SORT_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_STABLE_SORT_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_STABLE_SORT_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
|
||||
|
@ -24,4 +24,4 @@ namespace sprout {
|
|||
stable_sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp);
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_STABLE_SORT_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_STABLE_SORT_HPP
|
||||
|
|
|
@ -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_SWAP_RANGES_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_SWAP_RANGES_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_SWAP_RANGES_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_SWAP_RANGES_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/algorithm/cxx14/iter_swap.hpp>
|
||||
|
@ -25,4 +25,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_SWAP_RANGES_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_SWAP_RANGES_HPP
|
||||
|
|
|
@ -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_TRANSFORM_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_TRANSFORM_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_TRANSFORM_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_TRANSFORM_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/iterator/type_traits/is_iterator_of.hpp>
|
||||
|
@ -40,4 +40,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_TRANSFORM_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_TRANSFORM_HPP
|
||||
|
|
|
@ -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_UNIQUE_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_UNIQUE_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_UNIQUE_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_UNIQUE_HPP
|
||||
|
||||
#include <iterator>
|
||||
#include <sprout/config.hpp>
|
||||
|
@ -52,4 +52,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_UNIQUE_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_UNIQUE_HPP
|
||||
|
|
|
@ -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_UNIQUE_COPY_HPP
|
||||
#define SPROUT_CXX14_ALGORITHM_UNIQUE_COPY_HPP
|
||||
#ifndef SPROUT_ALGORITHM_CXX14_UNIQUE_COPY_HPP
|
||||
#define SPROUT_ALGORITHM_CXX14_UNIQUE_COPY_HPP
|
||||
|
||||
#include <iterator>
|
||||
#include <sprout/config.hpp>
|
||||
|
@ -58,4 +58,4 @@ namespace sprout {
|
|||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CXX14_ALGORITHM_UNIQUE_COPY_HPP
|
||||
#endif // #ifndef SPROUT_ALGORITHM_CXX14_UNIQUE_COPY_HPP
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
#define SPROUT_NUMERIC_CXX14_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
//#include <sprout/numeric/cxx14/partial_sum.hpp>
|
||||
//#include <sprout/numeric/cxx14/adjacent_difference.hpp>
|
||||
//#include <sprout/numeric/cxx14/iota.hpp>
|
||||
#include <sprout/numeric/cxx14/partial_sum.hpp>
|
||||
#include <sprout/numeric/cxx14/adjacent_difference.hpp>
|
||||
#include <sprout/numeric/cxx14/iota.hpp>
|
||||
|
||||
#endif // #ifndef SPROUT_NUMERIC_CXX14_HPP
|
||||
|
|
54
sprout/numeric/cxx14/adjacent_difference.hpp
Normal file
54
sprout/numeric/cxx14/adjacent_difference.hpp
Normal 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
|
27
sprout/numeric/cxx14/iota.hpp
Normal file
27
sprout/numeric/cxx14/iota.hpp
Normal 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
|
52
sprout/numeric/cxx14/partial_sum.hpp
Normal file
52
sprout/numeric/cxx14/partial_sum.hpp
Normal 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
|
|
@ -11,6 +11,8 @@
|
|||
#include <sprout/config.hpp>
|
||||
#include <sprout/container/traits.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/clamp_range_copy.hpp>
|
||||
|
||||
|
@ -20,7 +22,10 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
clamp_range_copy(
|
||||
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);
|
||||
}
|
||||
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
|
||||
clamp_range_copy(
|
||||
InputRange const& rng, Result const& result,
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include <sprout/config.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/copy.hpp>
|
||||
|
||||
|
@ -19,7 +21,10 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
copy(InputRange const& rng, Result const& result) {
|
||||
return sprout::fixed::copy(sprout::begin(rng), sprout::end(rng), result);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include <sprout/config.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/copy_backward.hpp>
|
||||
|
||||
|
@ -19,7 +21,10 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
copy_backward(BidirectionalRange const& rng, Result const& result) {
|
||||
return sprout::fixed::copy_backward(sprout::begin(rng), sprout::end(rng), result);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include <sprout/config.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/copy_if.hpp>
|
||||
|
||||
|
@ -19,7 +21,10 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
copy_if(InputRange const& rng, Result const& result, Predicate pred) {
|
||||
return sprout::fixed::copy_if(sprout::begin(rng), sprout::end(rng), result, pred);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include <sprout/config.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/copy_until.hpp>
|
||||
|
||||
|
@ -19,7 +21,10 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
copy_until(InputRange const& rng, Result const& result, Predicate pred) {
|
||||
return sprout::fixed::copy_until(sprout::begin(rng), sprout::end(rng), result, pred);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include <sprout/config.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/copy_while.hpp>
|
||||
|
||||
|
@ -19,7 +21,10 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
copy_while(InputRange const& rng, Result const& result, Predicate pred) {
|
||||
return sprout::fixed::copy_while(sprout::begin(rng), sprout::end(rng), result, pred);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include <sprout/config.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/merge.hpp>
|
||||
|
||||
|
@ -19,12 +21,18 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
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);
|
||||
}
|
||||
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
|
||||
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);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include <sprout/config.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/partition_copy.hpp>
|
||||
|
||||
|
@ -19,7 +21,10 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
partition_copy(InputRange const& rng, Result const& result, Predicate pred) {
|
||||
return sprout::fixed::partition_copy(sprout::begin(rng), sprout::end(rng), result, pred);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include <sprout/config.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/remove_copy.hpp>
|
||||
|
||||
|
@ -19,7 +21,10 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
remove_copy(InputRange const& rng, Result const& result, T const& value) {
|
||||
return sprout::fixed::remove_copy(sprout::begin(rng), sprout::end(rng), result, value);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include <sprout/config.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/remove_copy_if.hpp>
|
||||
|
||||
|
@ -19,7 +21,10 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
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);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include <sprout/config.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/replace_copy.hpp>
|
||||
|
||||
|
@ -19,7 +21,10 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
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);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include <sprout/config.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/replace_copy_if.hpp>
|
||||
|
||||
|
@ -19,7 +21,10 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
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);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include <sprout/config.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/reverse_copy.hpp>
|
||||
|
||||
|
@ -19,7 +21,10 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
reverse_copy(BidirectionalRange const& rng, Result const& result) {
|
||||
return sprout::fixed::reverse_copy(sprout::begin(rng), sprout::end(rng), result);
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
#include <sprout/config.hpp>
|
||||
#include <sprout/container/traits.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/rotate_copy.hpp>
|
||||
|
||||
|
@ -20,7 +22,10 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
rotate_copy(
|
||||
ForwardRange const& rng, typename sprout::container_traits<ForwardRange>::const_iterator middle,
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include <sprout/config.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/set_difference.hpp>
|
||||
|
||||
|
@ -19,12 +21,18 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
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);
|
||||
}
|
||||
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
|
||||
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);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include <sprout/config.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/set_intersection.hpp>
|
||||
|
||||
|
@ -19,12 +21,18 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
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);
|
||||
}
|
||||
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
|
||||
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);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include <sprout/config.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/set_symmetric_difference.hpp>
|
||||
|
||||
|
@ -19,12 +21,18 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
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);
|
||||
}
|
||||
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
|
||||
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);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include <sprout/config.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/set_union.hpp>
|
||||
|
||||
|
@ -19,12 +21,18 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
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);
|
||||
}
|
||||
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
|
||||
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);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include <sprout/config.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/stable_partition_copy.hpp>
|
||||
|
||||
|
@ -19,7 +21,10 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
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);
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
#include <sprout/config.hpp>
|
||||
#include <sprout/container/traits.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/swap_element_copy.hpp>
|
||||
|
||||
|
@ -20,7 +22,10 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
swap_element_copy(
|
||||
ForwardRange const& rng, Result const& result,
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include <sprout/config.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/transform.hpp>
|
||||
|
||||
|
@ -19,12 +21,18 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
transform(InputRange const& rng, Result const& result, UnaryOperation 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
|
||||
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);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include <sprout/config.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/unique_copy.hpp>
|
||||
|
||||
|
@ -19,12 +21,18 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
unique_copy(InputRange const& rng, Result const& result, BinaryPredicate 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
|
||||
unique_copy(InputRange const& rng, Result const& result) {
|
||||
return sprout::fixed::unique_copy(sprout::begin(rng), sprout::end(rng), result);
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
#include <sprout/config.hpp>
|
||||
#include <sprout/container/traits.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/numeric/fixed/adjacent_difference.hpp>
|
||||
|
||||
|
@ -20,12 +22,18 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
adjacent_difference(InputRange const& rng, Result const& 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
|
||||
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);
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
#include <sprout/config.hpp>
|
||||
#include <sprout/container/traits.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/numeric/fixed/partial_sum.hpp>
|
||||
|
||||
|
@ -20,12 +22,18 @@ namespace sprout {
|
|||
//
|
||||
// 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
|
||||
partial_sum(InputRange const& rng, Result const& 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
|
||||
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);
|
||||
|
|
Loading…
Add table
Reference in a new issue