8 #ifndef SIG_UTIL_REST_HPP
9 #define SIG_UTIL_REST_HPP
11 #include "../helper/helper_modules.hpp"
12 #include "../helper/container_helper.hpp"
13 #include "../modify/sort.hpp"
32 template <
class T1,
class T2,
33 class TC =
typename std::common_type<T1, T2>::type,
34 class C = std::vector<TC>
36 C
seqn(T1 st, T2 d, uint n)
40 for (uint i = 0; i<n; ++i) impl::container_traits<C>::add_element(result,
static_cast<TC
>(st) + i * static_cast<TC>(d));
45 #if SIG_GCC_GT4_8_0 || SIG_CLANG_GT_3_4 || !(SIG_MSVC_VER <= 120)
51 template <
class F,
class C,
52 typename std::enable_if<impl::container_traits<typename impl::remove_const_reference<C>::type>::exist>::type*& =
enabler
54 auto sort(F&& binary_op, C&& data)
56 auto result = std::forward<C>(data);
58 sort(result, std::forward<F>(binary_op));
auto sort(C &container, F &&binary_op) -> decltype(impl::eval(std::forward< F >(binary_op), std::declval< T >(), std::declval< T >()), void())
標準ソート関数のラッパ
C seqn(T1 st, T2 d, uint n)
等差数列