13 #ifndef TINYMPL_VARIADIC_COPY_N_HPP
14 #define TINYMPL_VARIADIC_COPY_N_HPP
33 template<std::size_t n,
template<
class ...>
class Out,
class ... Args>
36 template<std::size_t n,
37 template<
class ...>
class Out,
38 class Head,
class ... Tail>
39 struct copy_n<n, Out, Head, Tail...> {
41 template<
class ... CopiedElements>
struct impl {
42 typedef typename copy_n < n - 1, Out, Tail... >::template
43 impl<CopiedElements..., Head>::type type;
46 template<std::size_t,
template<
class ...>
class,
class ...>
50 static_assert( n <= 1 +
sizeof...( Tail ),
"n overflow" );
51 typedef typename impl<>::type type;
54 template<
template<
class ...>
class Out,
class Head,
class ... Tail>
55 struct copy_n<0, Out, Head, Tail...> {
57 template<
class ... CopiedElements>
struct impl {
58 typedef Out<CopiedElements...> type;
61 template<std::size_t,
template<
class ...>
class,
class ...>
65 typedef typename impl<>::type type;
68 template<
template<
class ...>
class Out>
struct copy_n<0, Out> {
70 template<
class ... CopiedElements>
struct impl {
71 typedef Out<CopiedElements...> type;
74 template<std::size_t,
template<
class ...>
class,
class ...>
78 typedef typename impl<>::type type;
85 #endif // TINYMPL_VARIADIC_COPY_N_HPP
Copy the first N elements from the input sequence.
Definition: copy_n.hpp:37
Copy the first n elements from the input sequence.
Definition: copy_n.hpp:34