#include <type_traits>
#include <utility>
#include <tuple>
template < template < auto ...> class > struct functor_wrapper;
namespace detail {
template < typename T>
struct identity { using type = T; } ;
template < typename Pack>
struct simple_pack : identity< Pack> { } ;
template < typename T, template < typename U, U...> class Z, T... Is >
struct simple_pack< Z< T, Is...>> {
template < T...> struct Q;
using type = Q< Is...> ;
} ;
template < typename ... Packs >
struct sequence_traits;
template < typename T, template < T...> class Z, T... Is >
struct sequence_traits< Z< Is...>> {
using value_type = T;
using template_empty = Z<> ;
} ;
template < typename T, template < typename U, U...> class Z, T... Is >
struct sequence_traits< Z< T, Is...>> {
using value_type = T;
using template_empty = Z< T> ;
} ;
template < typename First, typename ... Rest >
struct sequence_traits< First, Rest...> : sequence_traits< First> { } ;
template < template < auto ...> class F, typename Second, typename ... Rest >
struct sequence_traits< functor_wrapper< F> , Second, Rest...> : sequence_traits< Second> { } ;
template < typename Pack> struct is_empty : std:: false_type { } ;
template < template < typename ...> class P, typename ... Ts >
struct is_empty< P< Ts...>> : std:: bool_constant < ( sizeof ...( Ts) == 0 ) > { } ; // Empty pack of types.
template < template < auto ...> class Z, auto ... Is > // 'auto' (C++17) needed else the type T would need to be made explicit as an extra template parameter.
struct is_empty< Z< Is...>> : std:: bool_constant < ( sizeof ...( Is) == 0 ) > { } ; // Empty sequence.
template < typename T, template < typename U, U...> class Z, T... Is >
struct is_empty< Z< T, Is...>> : std:: bool_constant < ( sizeof ...( Is) == 0 ) > { } ; // e.g. std::integer_sequence<int> shall be considered empty.
template < typename Pack> struct first_element;
template < typename T, template < T...> class Z, T First, T... Rest >
struct first_element< Z< First, Rest...>> : std:: integral_constant < T, First> { } ;
template < typename T, template < typename U, U...> class Z, T First, T... Rest >
struct first_element< Z< T, First, Rest...>> : std:: integral_constant < T, First> { } ;
template < typename ...> struct last;
template < typename First, typename ... Rest >
struct last< First, Rest...> : last< Rest...> { } ;
template < typename Last>
struct last< Last> : identity< Last> { } ;
// The rest needed for Transform and TransformToEnd
template < typename ... Packs > struct empty_pack;
template < template < auto ...> class Z, auto ... Is , typename ... Packs >
struct empty_pack< Z< Is...> , Packs...> {
using type = Z<> ;
} ;
template < std:: size_t N, typename Pack, typename = void > struct get_element;
template < std:: size_t N, typename T, template < T...> class Z, T... Is >
struct get_element< N, Z< Is...> , std:: enable_if_t < ( N < sizeof ...( Is) ) >> {
static constexpr T a[ sizeof ...( Is) ] = { Is...} ;
static constexpr T value = a[ N] ;
} ;
// If N is greater than or equal to sizeof...(Is), then it shall output value T{} (which is zero if T is an integral type).
template < std:: size_t N, typename T, template < T...> class Z, T... Is >
struct get_element< N, Z< Is...> , std:: enable_if_t < ( N >= sizeof ...( Is) ) >> : std:: integral_constant < T, T{ } > { } ;
template < typename Pack, auto V> struct append;
template < template < auto ...> class Z, auto ... Is , auto V>
struct append< Z< Is...> , V> {
using type = Z< Is..., V> ;
} ;
template < typename Sequence> struct sequence_size;
template < template < auto ...> class Z, auto ... Is >
struct sequence_size< Z< Is...>> : std:: integral_constant < std:: size_t , sizeof ...( Is) > { } ;
template < template < auto , auto > class Comparator, auto ...> struct extreme_value;
template < template < auto , auto > class Comparator, auto A, auto B>
struct extreme_value< Comparator, A,B> : std:: integral_constant < decltype( A) , Comparator< A,B> :: value ? A : B> { } ;
template < template < auto , auto > class Comparator, auto First, auto Second, auto ... Rest >
struct extreme_value< Comparator, First, Second, Rest...> : extreme_value< Comparator, First, extreme_value< Comparator, Second, Rest...> :: value > { } ;
}
template < typename EmptyContainer, auto ... Is > struct output; // 'auto' (C++17) used else the type T would need to be made explicit as an extra template parameter.
template < template < auto ...> class Z, auto ... Is >
struct output< Z<> , Is...> {
using type = Z< Is...> ;
} ;
template < typename T, template < typename U, U...> class Z, T... Is >
struct output< Z< T> , Is...> {
using type = Z< T, Is...> ;
} ;
template < typename EmptyContainer, typename Output> struct output_h;
template < typename EmptyContainer, template < auto ...> class Z, auto ... Is >
struct output_h< EmptyContainer, Z< Is...>> : output< EmptyContainer, Is...> { } ;
enum CombineType { Merge, FirstFromEach, Interlace, Transform, TransformToEnd} ;
template < CombineType, typename EmptyPack, typename ... Packs > struct combine_packs_h;
// Merge
template < typename EmptyPack, typename T, template < T...> class Z, T... Is >
struct combine_packs_h< Merge, EmptyPack, Z< Is...>> : output< EmptyPack, Is...> { } ;
template < typename EmptyPack, typename T, template < T...> class Z, T... Is , template < T...> class Q, T... Js >
struct combine_packs_h< Merge, EmptyPack, Z< Is...> , Q< Js...>> : output< EmptyPack, Is..., Js...> { } ; // Note that using 'Z<Is...>, Z<Js...>' is not good enough since simple_pack<Pack1>::type does not have the same template as simple_pack<Pack2>::type.
template < typename EmptyPack, typename First, typename ... Rest >
struct combine_packs_h< Merge, EmptyPack, First, Rest...> : combine_packs_h< Merge, EmptyPack, First, typename combine_packs_h< Merge, typename detail:: sequence_traits < Rest...> :: template_empty , Rest...> :: type > { } ;
// Note that using EmptyPack instead of typename detail::sequence_traits<Rest...>::template_empty is incorrect because EmptyPack might not be the proper empty pack type for the first pack in Rest...
// FirstFromEach
template < typename EmptyPack, typename ... Packs >
struct combine_packs_h< FirstFromEach, EmptyPack, Packs...> : output< EmptyPack, detail:: first_element < Packs> :: value ...> { } ;
// Interlace
template < typename Output, typename ... Packs > struct interlace;
template < typename T, template < T...> class Q, T... Is >
struct interlace< Q< Is...>> : detail:: identity < Q< Is...>> { } ;
template < typename T, template < T...> class Q, T... Output , template < T...> class Z, T First, T... Rest , typename ... Packs >
struct interlace< Q< Output...> , Z< First, Rest...> , Packs...> : interlace< Q< Output..., First> , Packs..., Z< Rest...>> { } ;
template < typename T, template < T...> class Q, T... Output , template < T...> class Z, typename ... Packs >
struct interlace< Q< Output...> , Z<> , Packs...> : interlace< Q< Output...> , Packs...> { } ;
template < typename EmptyPack, typename ... Packs >
struct combine_packs_h< Interlace, EmptyPack, Packs...> : output_h< EmptyPack, typename interlace< typename detail:: simple_pack < EmptyPack> :: type , Packs...> :: type > { } ;
// Transform and TransformToEnd (adapted from transform_generalized.cpp)
template < auto A, auto B>
struct less_than : std:: bool_constant < ( A < B) > { } ;
template < auto A, auto B>
struct greater_than : std:: bool_constant < ( A > B) > { } ;
template < template < auto ...> class F, std:: size_t N, std:: size_t End, typename Output, typename ... Packs >
struct transform_h : transform_h< F, N+ 1 , End, typename detail:: append < Output, F< detail:: get_element < N, Packs> :: value ...> :: value > :: type , Packs...> { } ;
template < template < auto ...> class F, std:: size_t End, typename Output, typename ... Packs >
struct transform_h< F, End, End, Output, Packs...> : detail:: identity < Output> { } ;
template < typename EmptyPack, template < auto , auto > class Comparator, template < auto ...> class F, typename ... Packs >
using do_transform = output_h< EmptyPack, typename transform_h< F, 0 , detail:: extreme_value < Comparator, detail:: sequence_size < Packs> :: value ...> :: value , typename detail:: empty_pack < Packs...> :: type , Packs...> :: type > ;
template < typename EmptyPack, template < auto ...> class F, typename ... Packs >
struct combine_packs_h< Transform, EmptyPack, functor_wrapper< F> , Packs...> : do_transform< EmptyPack, less_than, F, Packs...> { } ;
template < typename EmptyPack, template < auto ...> class F, typename ... Packs >
struct combine_packs_h< TransformToEnd, EmptyPack, functor_wrapper< F> , Packs...> : do_transform< EmptyPack, greater_than, F, Packs...> { } ;
// combine_packs
template < typename Pack> struct remove_last;
template < CombineType C, template < CombineType, typename ...> class P, typename EmptyPack, typename ... Ts >
struct remove_last< P< C, EmptyPack, Ts...>> {
template < std:: size_t ... Is >
static auto execute ( const std:: index_sequence < Is...> & ) - > P< C, EmptyPack, std:: tuple_element_t < Is, std:: tuple < Ts...>> ...> ;
using type = decltype( execute( std:: make_index_sequence < sizeof ...( Ts) - 1 > { } ) ) ;
} ;
template < CombineType C, typename ... Packs > // The first pack P in Packs... could be functor_wrapper<F> if CombineType is Transform or TransformToEnd, in which simple_pack<P>::type is simply P due to the use of detail::identity.
struct combine_packs {
using Last = typename detail:: last < Packs...> :: type ; // Use split_last, so that Last is obtained, as well as all the packs except Last.
static constexpr bool LastPackIsEmpty = detail:: is_empty < Last> :: value ;
using EmptyPack = std:: conditional_t < LastPackIsEmpty, Last, typename detail:: sequence_traits < Packs...> :: template_empty > ; // Change this if first pack is a Functor
using pack = combine_packs_h< C, EmptyPack, typename detail:: simple_pack < Packs> :: type ...> ;
using meta = std:: conditional_t < LastPackIsEmpty, typename remove_last< pack> :: type , pack> ;
using type = typename meta:: type ;
// using type = typename combine_packs_h<C, EmptyPack, typename detail::simple_pack<Packs>::type...>::type; // This original line of mine is incorrect. We must remove the last pack from Packs... if detail::is_empty<Last>::value == true (since that last pack is empty).
} ;
// The following (original) syntax for combine_packs is awkward, because the EmptyPack must always be given even if we want the default no change in container template.
//template <CombineType C, typename EmptyPack, typename... Packs> // The first pack P in Packs... could be a meta-function struct if CombineType is Transform, in which simple_pack<P>::type is simply P.
//struct combine_packs : combine_packs_h<C, EmptyPack, typename detail::simple_pack<Packs>::type...> {};
// Testing
#include <iostream>
template < int ...> struct Z { } ;
template < int ...> struct Q;
template < int ...> struct R;
template < std:: size_t ...> struct I;
template < int A, int B, int C>
struct foo : std:: integral_constant < int , A + 2 * B + 3 * C> { } ;
int main( ) {
std:: cout << std:: boolalpha << std:: is_same <
combine_packs< Merge, Z< 0 ,1 ,2 ,3 > , Q< 4 ,5 ,6 > , R<>> :: type ,
R< 0 ,1 ,2 ,3 ,4 ,5 ,6 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< Merge, Z< 0 ,1 ,2 ,3 > , Z< 4 ,5 ,6 >> :: type ,
Z< 0 ,1 ,2 ,3 ,4 ,5 ,6 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< Merge, Z< 0 ,1 ,2 ,3 > , Q< 4 ,5 ,6 > , R< 7 ,8 >> :: type ,
Z< 0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< Merge, std:: index_sequence < 0 ,1 ,2 ,3 >> :: type ,
std:: index_sequence < 0 ,1 ,2 ,3 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< Merge, std:: index_sequence < 0 ,1 ,2 ,3 > , std:: index_sequence < 4 ,5 ,6 >> :: type ,
std:: index_sequence < 0 ,1 ,2 ,3 ,4 ,5 ,6 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< Merge, std:: index_sequence < 0 ,1 ,2 ,3 > , std:: index_sequence < 4 ,5 ,6 > , std:: index_sequence < 7 ,8 > , I<>> :: type ,
I< 0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< Merge, std:: index_sequence < 0 ,1 ,2 ,3 > , I< 4 ,5 ,6 > , std:: index_sequence < 7 ,8 > , std:: integer_sequence < std:: size_t >> :: type ,
std:: integer_sequence < std:: size_t , 0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< Merge, std:: index_sequence < 0 ,1 ,2 ,3 > , I< 4 ,5 ,6 > , I< 7 ,8 > , std:: index_sequence < 9 >> :: type ,
std:: index_sequence < 0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< Merge, std:: make_index_sequence < 4 > , std:: index_sequence < 4 ,5 ,6 > , std:: index_sequence < 7 ,8 > , std:: index_sequence < 9 > , I<>> :: type ,
I< 0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< Merge, I< 0 ,1 ,2 ,3 > , I< 4 ,5 ,6 > , I< 7 ,8 > , I< 9 > , std:: integer_sequence < std:: size_t >> :: type ,
std:: index_sequence < 0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< FirstFromEach, Z< 0 ,1 ,2 ,3 > , Z< 4 ,5 ,6 > , Z< 7 ,8 > , Z< 9 >> :: type ,
Z< 0 ,4 ,7 ,9 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< FirstFromEach, Z< 0 ,1 ,2 ,3 > , Q< 4 ,5 ,6 > , Z< 7 ,8 > , R< 9 >> :: type ,
Z< 0 ,4 ,7 ,9 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< FirstFromEach, std:: make_index_sequence < 10 > , std:: index_sequence < 4 ,5 ,6 > , I< 7 ,8 > , std:: index_sequence < 9 >> :: type ,
std:: index_sequence < 0 ,4 ,7 ,9 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< FirstFromEach, Z< 0 ,1 ,2 ,3 > , Z< 4 ,5 ,6 > , Z< 7 ,8 > , Z< 9 > , Q<>> :: type ,
Q< 0 ,4 ,7 ,9 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< FirstFromEach, std:: make_index_sequence < 10 > , I< 4 ,5 ,6 > , Z< 7 ,8 > , std:: index_sequence < 9 > , I<>> :: type ,
I< 0 ,4 ,7 ,9 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< FirstFromEach, std:: make_index_sequence < 10 > , R< 4 ,5 ,6 > , Z< 7 ,8 > , I< 9 > , std:: integer_sequence < std:: size_t >> :: type ,
std:: index_sequence < 0 ,4 ,7 ,9 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< Interlace, Z< 0 ,1 ,2 > , Z< 3 ,4 ,5 > , Z< 6 ,7 ,8 >> :: type ,
Z< 0 ,3 ,6 ,1 ,4 ,7 ,2 ,5 ,8 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< Interlace, Z< 0 ,1 ,2 > , Q< 3 ,4 > , R< 5 ,6 ,7 ,8 ,9 ,10 >> :: type ,
Z< 0 ,3 ,5 ,1 ,4 ,6 ,2 ,7 ,8 ,9 ,10 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< Interlace, std:: index_sequence < 0 ,1 ,2 > , I< 3 ,4 > , std:: index_sequence < 5 ,6 ,7 ,8 ,9 ,10 >> :: type ,
std:: index_sequence < 0 ,3 ,5 ,1 ,4 ,6 ,2 ,7 ,8 ,9 ,10 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< Interlace, std:: index_sequence < 0 ,1 ,2 > , std:: index_sequence < 3 ,4 > , std:: index_sequence < 5 ,6 ,7 ,8 ,9 ,10 > , I<>> :: type ,
I< 0 ,3 ,5 ,1 ,4 ,6 ,2 ,7 ,8 ,9 ,10 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< Transform, functor_wrapper< foo> , Z< 2 ,4 ,- 2 ,6 ,2 ,2 ,2 > , Z< 5 ,10 ,- 5 ,15 > , Z< 1 ,2 ,- 1 ,3 ,1 >> :: type ,
Z< 15 ,30 ,- 15 ,45 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< TransformToEnd, functor_wrapper< foo> , Z< 2 ,4 ,- 2 ,6 ,2 ,2 ,2 > , Z< 5 ,10 ,- 5 ,15 > , Z< 1 ,2 ,- 1 ,3 ,1 >> :: type ,
Z< 15 ,30 ,- 15 ,45 ,5 ,2 ,2 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< Transform, functor_wrapper< foo> , Q< 2 ,4 ,- 2 ,6 ,2 ,2 ,2 > , Z< 5 ,10 ,- 5 ,15 > , R< 1 ,2 ,- 1 ,3 ,1 >> :: type ,
Q< 15 ,30 ,- 15 ,45 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< TransformToEnd, functor_wrapper< foo> , Z< 2 ,4 ,- 2 ,6 ,2 ,2 ,2 > , Q< 5 ,10 ,- 5 ,15 > , R< 1 ,2 ,- 1 ,3 ,1 > , R<>> :: type ,
R< 15 ,30 ,- 15 ,45 ,5 ,2 ,2 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< Transform, functor_wrapper< foo> , std:: index_sequence < 2 ,4 ,- 2 ,6 ,2 ,2 ,2 > , std:: index_sequence < 5 ,10 ,- 5 ,15 > , std:: index_sequence < 1 ,2 ,- 1 ,3 ,1 >> :: type ,
std:: index_sequence < 15 ,30 ,- 15 ,45 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< TransformToEnd, functor_wrapper< foo> , std:: index_sequence < 2 ,4 ,- 2 ,6 ,2 ,2 ,2 > , I< 5 ,10 ,- 5 ,15 > , std:: index_sequence < 1 ,2 ,- 1 ,3 ,1 > , I<>> :: type ,
I< 15 ,30 ,- 15 ,45 ,5 ,2 ,2 >
> :: value << '\n ' ; // true
std:: cout << std:: is_same <
combine_packs< TransformToEnd, functor_wrapper< foo> , I< 2 ,4 ,- 2 ,6 ,2 ,2 ,2 > , I< 5 ,10 ,- 5 ,15 > , std:: index_sequence < 1 ,2 ,- 1 ,3 ,1 > , std:: integer_sequence < std:: size_t >> :: type ,
std:: index_sequence < 15 ,30 ,- 15 ,45 ,5 ,2 ,2 >
> :: value << '\n ' ; // true
std:: cin .get ( ) ;
}
I2luY2x1ZGUgPHR5cGVfdHJhaXRzPgojaW5jbHVkZSA8dXRpbGl0eT4KI2luY2x1ZGUgPHR1cGxlPgoKdGVtcGxhdGUgPHRlbXBsYXRlIDxhdXRvLi4uPiBjbGFzcz4gc3RydWN0IGZ1bmN0b3Jfd3JhcHBlcjsKCm5hbWVzcGFjZSBkZXRhaWwgewoJdGVtcGxhdGUgPHR5cGVuYW1lIFQ+CglzdHJ1Y3QgaWRlbnRpdHkgeyB1c2luZyB0eXBlID0gVDsgfTsKCQoJdGVtcGxhdGUgPHR5cGVuYW1lIFBhY2s+CglzdHJ1Y3Qgc2ltcGxlX3BhY2sgOiBpZGVudGl0eTxQYWNrPiB7fTsKCQoJdGVtcGxhdGUgPHR5cGVuYW1lIFQsIHRlbXBsYXRlIDx0eXBlbmFtZSBVLCBVLi4uPiBjbGFzcyBaLCBULi4uIElzPgoJc3RydWN0IHNpbXBsZV9wYWNrPFo8VCwgSX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PDIsNCwtMiw2LDIsMiwyPiwgc3RkOjppbmRleF9zZXF1ZW5jZTw1LDEwLC01LDE1Piwgc3RkOjppbmRleF9zZXF1ZW5jZTwxLDIsLTEsMywxPj46OnR5cGUsCgkJc3RkOjppbmRleF9zZXF1ZW5jZTwxNSwzMCwtMTUsNDU+Cgk+Ojp2YWx1ZSA8PCAnXG4nOyAgLy8gdHJ1ZQoKCXN0ZDo6Y291dCA8PCBzdGQ6OmlzX3NhbWU8CgkJY29tYmluZV9wYWNrczxUcmFuc2Zvcm1Ub0VuZCwgZnVuY3Rvcl93cmFwcGVyPGZvbz4sIHN0ZDo6aW5kZXhfc2VxdWVuY2U8Miw0LC0yLDYsMiwyLDI+LCBJPDUsMTAsLTUsMTU+LCBzdGQ6OmluZGV4X3NlcXVlbmNlPDEsMiwtMSwzLDE+LCBJPD4+Ojp0eXBlLAoJCUk8MTUsMzAsLTE1LDQ1LDUsMiwyPgoJPjo6dmFsdWUgPDwgJ1xuJzsgIC8vIHRydWUKCglzdGQ6OmNvdXQgPDwgc3RkOjppc19zYW1lPAoJCWNvbWJpbmVfcGFja3M8VHJhbnNmb3JtVG9FbmQsIGZ1bmN0b3Jfd3JhcHBlcjxmb28+LCBJPDIsNCwtMiw2LDIsMiwyPiwgSTw1LDEwLC01LDE1Piwgc3RkOjppbmRleF9zZXF1ZW5jZTwxLDIsLTEsMywxPiwgc3RkOjppbnRlZ2VyX3NlcXVlbmNlPHN0ZDo6c2l6ZV90Pj46OnR5cGUsCgkJc3RkOjppbmRleF9zZXF1ZW5jZTwxNSwzMCwtMTUsNDUsNSwyLDI+Cgk+Ojp2YWx1ZSA8PCAnXG4nOyAgLy8gdHJ1ZQoKCXN0ZDo6Y2luLmdldCgpOwp9Cg==
compilation info
prog.cpp:5:25: error: ‘auto’ parameter not permitted in this context
template <template <auto...> class> struct functor_wrapper;
^~~
prog.cpp:24:12: error: template parameters not deducible in partial specialization:
struct sequence_traits<Z<Is...>> {
^~~~~~~~~~~~~~~~~~~~~~~~~
prog.cpp:24:12: note: ‘T’
prog.cpp:38:26: error: ‘auto’ parameter not permitted in this context
template <template <auto...> class F, typename Second, typename... Rest>
^~~
prog.cpp:39:42: error: type/value mismatch at argument 1 in template parameter list for ‘template<template<<typeprefixerror>...<anonymous> > class<template-parameter-1-1> > struct functor_wrapper’
struct sequence_traits<functor_wrapper<F>, Second, Rest...> : sequence_traits<Second> {};
^
prog.cpp:39:42: note: expected a template of type ‘template<<typeprefixerror>...<anonymous> > class<template-parameter-1-1>’, got ‘template<<typeprefixerror>...<anonymous> > class F’
prog.cpp:39:60: error: template argument 1 is invalid
struct sequence_traits<functor_wrapper<F>, Second, Rest...> : sequence_traits<Second> {};
^
prog.cpp:44:48: error: expected template-name before ‘<’ token
struct is_empty<P<Ts...>> : std::bool_constant<(sizeof...(Ts) == 0)> {}; // Empty pack of types.
^
prog.cpp:44:48: error: expected ‘{’ before ‘<’ token
prog.cpp:46:26: error: ‘auto’ parameter not permitted in this context
template <template <auto...> class Z, auto... Is> // 'auto' (C++17) needed else the type T would need to be made explicit as an extra template parameter.
^~~
prog.cpp:46:48: error: ‘auto’ parameter not permitted in this context
template <template <auto...> class Z, auto... Is> // 'auto' (C++17) needed else the type T would need to be made explicit as an extra template parameter.
^~
prog.cpp:47:22: note: invalid template non-type parameter
struct is_empty<Z<Is...>> : std::bool_constant<(sizeof...(Is) == 0)> {}; // Empty sequence.
^~~
prog.cpp:47:25: error: template argument 1 is invalid
struct is_empty<Z<Is...>> : std::bool_constant<(sizeof...(Is) == 0)> {}; // Empty sequence.
^~
prog.cpp:47:48: error: expected template-name before ‘<’ token
struct is_empty<Z<Is...>> : std::bool_constant<(sizeof...(Is) == 0)> {}; // Empty sequence.
^
prog.cpp:50:51: error: expected template-name before ‘<’ token
struct is_empty<Z<T, Is...>> : std::bool_constant<(sizeof...(Is) == 0)> {}; // e.g. std::integer_sequence<int> shall be considered empty.
^
prog.cpp:50:51: error: expected ‘{’ before ‘<’ token
prog.cpp:55:9: error: template parameters not deducible in partial specialization:
struct first_element<Z<First, Rest...>> : std::integral_constant<T, First> {};
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cpp:55:9: note: ‘T’
prog.cpp:71:26: error: ‘auto’ parameter not permitted in this context
template <template <auto...> class Z, auto... Is, typename... Packs>
^~~
prog.cpp:71:48: error: ‘auto’ parameter not permitted in this context
template <template <auto...> class Z, auto... Is, typename... Packs>
^~
prog.cpp:72:27: note: invalid template non-type parameter
struct empty_pack<Z<Is...>, Packs...> {
^
prog.cpp:72:38: error: template argument 1 is invalid
struct empty_pack<Z<Is...>, Packs...> {
^
prog.cpp:79:9: error: template parameters not deducible in partial specialization:
struct get_element<N, Z<Is...>, std::enable_if_t<(N < sizeof...(Is))>> {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cpp:79:9: note: ‘T’
prog.cpp:86:9: error: template parameters not deducible in partial specialization:
struct get_element<N, Z<Is...>, std::enable_if_t<(N >= sizeof...(Is))>> : std::integral_constant<T, T{}> {};
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cpp:86:9: note: ‘T’
prog.cpp:88:32: error: ‘auto’ parameter not permitted in this context
template <typename Pack, auto V> struct append;
^
prog.cpp:90:26: error: ‘auto’ parameter not permitted in this context
template <template <auto...> class Z, auto... Is, auto V>
^~~
prog.cpp:90:48: error: ‘auto’ parameter not permitted in this context
template <template <auto...> class Z, auto... Is, auto V>
^~
prog.cpp:90:57: error: ‘auto’ parameter not permitted in this context
template <template <auto...> class Z, auto... Is, auto V>
^
prog.cpp:91:23: note: invalid template non-type parameter
struct append<Z<Is...>, V> {
^
prog.cpp:91:27: error: template argument 1 is invalid
struct append<Z<Is...>, V> {
^
prog.cpp:91:27: note: invalid template non-type parameter
prog.cpp:97:26: error: ‘auto’ parameter not permitted in this context
template <template <auto...> class Z, auto... Is>
^~~
prog.cpp:97:48: error: ‘auto’ parameter not permitted in this context
template <template <auto...> class Z, auto... Is>
^~
prog.cpp:98:27: note: invalid template non-type parameter
struct sequence_size<Z<Is...>> : std::integral_constant<std::size_t, sizeof...(Is)> {};
^~~
prog.cpp:98:30: error: template argument 1 is invalid
struct sequence_size<Z<Is...>> : std::integral_constant<std::size_t, sizeof...(Is)> {};
^~
prog.cpp:100:22: error: ‘auto’ parameter not permitted in this context
template <template <auto, auto> class Comparator, auto...> struct extreme_value;
^~~~
prog.cpp:100:28: error: ‘auto’ parameter not permitted in this context
template <template <auto, auto> class Comparator, auto...> struct extreme_value;
^~~~
prog.cpp:100:56: error: ‘auto’ parameter not permitted in this context
template <template <auto, auto> class Comparator, auto...> struct extreme_value;
^~~
prog.cpp:102:22: error: ‘auto’ parameter not permitted in this context
template <template <auto, auto> class Comparator, auto A, auto B>
^~~~
prog.cpp:102:28: error: ‘auto’ parameter not permitted in this context
template <template <auto, auto> class Comparator, auto A, auto B>
^~~~
prog.cpp:102:57: error: ‘auto’ parameter not permitted in this context
template <template <auto, auto> class Comparator, auto A, auto B>
^
prog.cpp:102:65: error: ‘auto’ parameter not permitted in this context
template <template <auto, auto> class Comparator, auto A, auto B>
^
prog.cpp:103:38: error: type/value mismatch at argument 1 in template parameter list for ‘template<template<<typeprefixerror><anonymous>, <typeprefixerror><anonymous> > class Comparator, <typeprefixerror>...<anonymous> > struct detail::extreme_value’
struct extreme_value<Comparator, A,B> : std::integral_constant<decltype(A), Comparator<A,B>::value ? A : B> {};
^
prog.cpp:103:38: note: expected a template of type ‘template<<typeprefixerror><anonymous>, <typeprefixerror><anonymous> > class Comparator’, got ‘template<<typeprefixerror><anonymous>, <typeprefixerror><anonymous> > class Comparator’
prog.cpp:103:38: note: invalid template non-type parameter
prog.cpp:103:38: note: invalid template non-type parameter
prog.cpp:103:92: note: invalid template non-type parameter
struct extreme_value<Comparator, A,B> : std::integral_constant<decltype(A), Comparator<A,B>::value ? A : B> {};
^
prog.cpp:103:92: note: invalid template non-type parameter
prog.cpp:103:108: error: template argument 1 is invalid
struct extreme_value<Comparator, A,B> : std::integral_constant<decltype(A), Comparator<A,B>::value ? A : B> {};
^
prog.cpp:103:108: error: template argument 2 is invalid
prog.cpp:105:22: error: ‘auto’ parameter not permitted in this context
template <template <auto, auto> class Comparator, auto First, auto Second, auto... Rest>
^~~~
prog.cpp:105:28: error: ‘auto’ parameter not permitted in this context
template <template <auto, auto> class Comparator, auto First, auto Second, auto... Rest>
^~~~
prog.cpp:105:57: error: ‘auto’ parameter not permitted in this context
template <template <auto, auto> class Comparator, auto First, auto Second, auto... Rest>
^~~~~
prog.cpp:105:69: error: ‘auto’ parameter not permitted in this context
template <template <auto, auto> class Comparator, auto First, auto Second, auto... Rest>
^~~~~~
prog.cpp:105:85: error: ‘auto’ parameter not permitted in this context
template <template <auto, auto> class Comparator, auto First, auto Second, auto... Rest>
^~~~
prog.cpp:106:57: error: type/value mismatch at argument 1 in template parameter list for ‘template<template<<typeprefixerror><anonymous>, <typeprefixerror><anonymous> > class Comparator, <typeprefixerror>...<anonymous> > struct detail::extreme_value’
struct extreme_value<Comparator, First, Second, Rest...> : extreme_value<Comparator, First, extreme_value<Comparator, Second, Rest...>::value> {};
^
prog.cpp:106:57: note: expected a template of type ‘template<<typeprefixerror><anonymous>, <typeprefixerror><anonymous> > class Comparator’, got ‘template<<typeprefixerror><anonymous>, <typeprefixerror><anonymous> > class Comparator’
prog.cpp:106:57: note: invalid template non-type parameter
prog.cpp:106:57: note: invalid template non-type parameter
prog.cpp:106:57: note: invalid template non-type parameter
prog.cpp:106:135: error: type/value mismatch at argument 1 in template parameter list for ‘template<template<<typeprefixerror><anonymous>, <typeprefixerror><anonymous> > class Comparator, <typeprefixerror>...<anonymous> > struct detail::extreme_value’
struct extreme_value<Comparator, First, Second, Rest...> : extreme_value<Comparator, First, extreme_value<Comparator, Second, Rest...>::value> {};
^
prog.cpp:106:135: note: expected a template of type ‘template<<typeprefixerror><anonymous>, <typeprefixerror><anonymous> > class Comparator’, got ‘template<<typeprefixerror><anonymous>, <typeprefixerror><anonymous> > class Comparator’
prog.cpp:106:135: note: invalid template non-type parameter
prog.cpp:106:135: note: invalid template non-type parameter
prog.cpp:106:143: error: type/value mismatch at argument 1 in template parameter list for ‘template<template<<typeprefixerror><anonymous>, <typeprefixerror><anonymous> > class Comparator, <typeprefixerror>...<anonymous> > struct detail::extreme_value’
struct extreme_value<Comparator, First, Second, Rest...> : extreme_value<Comparator, First, extreme_value<Comparator, Second, Rest...>::value> {};
^
prog.cpp:106:143: note: expected a template of type ‘template<<typeprefixerror><anonymous>, <typeprefixerror><anonymous> > class Comparator’, got ‘template<<typeprefixerror><anonymous>, <typeprefixerror><anonymous> > class Comparator’
prog.cpp:106:143: note: invalid template non-type parameter
prog.cpp:106:143: error: template argument 3 is invalid
prog.cpp:109:44: error: ‘auto’ parameter not permitted in this context
template <typename EmptyContainer, auto... Is> struct output; // 'auto' (C++17) used else the type T would need to be made explicit as an extra template parameter.
^~
prog.cpp:111:25: error: ‘auto’ parameter not permitted in this context
template <template <auto...> class Z, auto... Is>
^~~
prog.cpp:111:47: error: ‘auto’ parameter not permitted in this context
template <template <auto...> class Z, auto... Is>
^~
prog.cpp:112:25: note: invalid template non-type parameter
struct output<Z<>, Is...> {
^
prog.cpp:117:26: note: invalid template non-type parameter
struct output<Z<T>, Is...> {
^
prog.cpp:123:50: error: ‘auto’ parameter not permitted in this context
template <typename EmptyContainer, template <auto...> class Z, auto... Is>
^~~
prog.cpp:123:72: error: ‘auto’ parameter not permitted in this context
template <typename EmptyContainer, template <auto...> class Z, auto... Is>
^~
prog.cpp:124:37: note: invalid template non-type parameter
struct output_h<EmptyContainer, Z<Is...>> : output<EmptyContainer, Is...> {};
^~~
prog.cpp:124:40: error: template argument 2 is invalid
struct output_h<EmptyContainer, Z<Is...>> : output<EmptyContainer, Is...> {};
^~
prog.cpp:124:73: note: invalid template non-type parameter
struct output_h<EmptyContainer, Z<Is...>> : output<EmptyContainer, Is...> {};
^
prog.cpp:132:8: error: template parameters not deducible in partial specialization:
struct combine_packs_h<Merge, EmptyPack, Z<Is...>> : output<EmptyPack, Is...> {};
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cpp:132:8: note: ‘T’
prog.cpp:132:77: note: invalid template non-type parameter
struct combine_packs_h<Merge, EmptyPack, Z<Is...>> : output<EmptyPack, Is...> {};
^
prog.cpp:135:8: error: template parameters not deducible in partial specialization:
struct combine_packs_h<Merge, EmptyPack, Z<Is...>, Q<Js...>> : output<EmptyPack, Is..., Js...> {}; // Note that using 'Z<Is...>, Z<Js...>' is not good enough since simple_pack<Pack1>::type does not have the same template as simple_pack<Pack2>::type.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cpp:135:8: note: ‘T’
prog.cpp:135:94: note: invalid template non-type parameter
struct combine_packs_h<Merge, EmptyPack, Z<Is...>, Q<Js...>> : output<EmptyPack, Is..., Js...> {}; // Note that using 'Z<Is...>, Z<Js...>' is not good enough since simple_pack<Pack1>::type does not have the same template as simple_pack<Pack2>::type.
^
prog.cpp:135:94: note: invalid template non-type parameter
prog.cpp:143:118: note: invalid template non-type parameter
struct combine_packs_h<FirstFromEach, EmptyPack, Packs...> : output<EmptyPack, detail::first_element<Packs>::value...> {};
^
prog.cpp:149:8: error: template parameters not deducible in partial specialization:
struct interlace<Q<Is...>> : detail::identity<Q<Is...>> {};
^~~~~~~~~~~~~~~~~~~
prog.cpp:149:8: note: ‘T’
prog.cpp:152:8: error: template parameters not deducible in partial specialization:
struct interlace<Q<Output...>, Z<First, Rest...>, Packs...> : interlace<Q<Output..., First>, Packs..., Z<Rest...>> {};
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cpp:152:8: note: ‘T’
prog.cpp:155:8: error: template parameters not deducible in partial specialization:
struct interlace<Q<Output...>, Z<>, Packs...> : interlace<Q<Output...>, Packs...> {};
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cpp:155:8: note: ‘T’
prog.cpp:161:16: error: ‘auto’ parameter not permitted in this context
template <auto A, auto B>
^
prog.cpp:161:24: error: ‘auto’ parameter not permitted in this context
template <auto A, auto B>
^
prog.cpp:162:38: error: expected template-name before ‘<’ token
struct less_than : std::bool_constant<(A < B)> {};
^
prog.cpp:162:38: error: expected ‘{’ before ‘<’ token
prog.cpp:164:16: error: ‘auto’ parameter not permitted in this context
template <auto A, auto B>
^
prog.cpp:164:24: error: ‘auto’ parameter not permitted in this context
template <auto A, auto B>
^
prog.cpp:165:41: error: expected template-name before ‘<’ token
struct greater_than : std::bool_constant<(A > B)> {};
^
prog.cpp:165:41: error: expected ‘{’ before ‘<’ token
prog.cpp:167:25: error: ‘auto’ parameter not permitted in this context
template <template <auto...> class F, std::size_t N, std::size_t End, typename Output, typename... Packs>
^~~
prog.cpp:168:120: note: invalid template non-type parameter
struct transform_h : transform_h<F, N+1, End, typename detail::append<Output, F<detail::get_element<N, Packs>::value...>::value>::type, Packs...> {};
^
prog.cpp:168:128: error: template argument 2 is invalid
struct transform_h : transform_h<F, N+1, End, typename detail::append<Output, F<detail::get_element<N, Packs>::value...>::value>::type, Packs...> {};
^
prog.cpp:168:145: error: type/value mismatch at argument 1 in template parameter list for ‘template<template<<typeprefixerror>...<anonymous> > class F, long unsigned int N, long unsigned int End, class Output, class ... Packs> struct transform_h’
struct transform_h : transform_h<F, N+1, End, typename detail::append<Output, F<detail::get_element<N, Packs>::value...>::value>::type, Packs...> {};
^
prog.cpp:168:145: note: expected a template of type ‘template<<typeprefixerror>...<anonymous> > class F’, got ‘template<<typeprefixerror>...<anonymous> > class F’
prog.cpp:168:145: error: template argument 4 is invalid
prog.cpp:170:25: error: ‘auto’ parameter not permitted in this context
template <template <auto...> class F, std::size_t End, typename Output, typename... Packs>
^~~
prog.cpp:171:49: error: type/value mismatch at argument 1 in template parameter list for ‘template<template<<typeprefixerror>...<anonymous> > class F, long unsigned int N, long unsigned int End, class Output, class ... Packs> struct transform_h’
struct transform_h<F, End, End, Output, Packs...> : detail::identity<Output> {};
^
prog.cpp:171:49: note: expected a template of type ‘template<<typeprefixerror>...<anonymous> > class F’, got ‘template<<typeprefixerror>...<anonymous> > class F’
prog.cpp:173:41: error: ‘auto’ parameter not permitted in this context
template <typename EmptyPack, template <auto, auto> class Comparator, template <auto...> class F, typename... Packs>
^~~~
prog.cpp:173:47: error: ‘auto’ parameter not permitted in this context
template <typename EmptyPack, template <auto, auto> class Comparator, template <auto...> class F, typename... Packs>
^~~~
prog.cpp:173:85: error: ‘auto’ parameter not permitted in this context
template <typename EmptyPack, template <auto, auto> class Comparator, template <auto...> class F, typename... Packs>
^~~
prog.cpp:174:141: error: type/value mismatch at argument 1 in template parameter list for ‘template<template<<typeprefixerror><anonymous>, <typeprefixerror><anonymous> > class Comparator, <typeprefixerror>...<anonymous> > struct detail::extreme_value’
using do_transform = output_h<EmptyPack, typename transform_h<F, 0, detail::extreme_value<Comparator, detail::sequence_size<Packs>::value...>::value, typename detail::empty_pack<Packs...>::type, Packs...>::type>;
^
prog.cpp:174:141: note: expected a template of type ‘template<<typeprefixerror><anonymous>, <typeprefixerror><anonymous> > class Comparator’, got ‘template<<typeprefixerror><anonymous>, <typeprefixerror><anonymous> > class Comparator’
prog.cpp:174:141: note: invalid template non-type parameter
prog.cpp:174:204: error: type/value mismatch at argument 1 in template parameter list for ‘template<template<<typeprefixerror>...<anonymous> > class F, long unsigned int N, long unsigned int End, class Output, class ... Packs> struct transform_h’
using do_transform = output_h<EmptyPack, typename transform_h<F, 0, detail::extreme_value<Comparator, detail::sequence_size<Packs>::value...>::value, typename detail::empty_pack<Packs...>::type, Packs...>::type>;
^
prog.cpp:174:204: note: expected a template of type ‘template<<typeprefixerror>...<anonymous> > class F’, got ‘template<<typeprefixerror>...<anonymous> > class F’
prog.cpp:174:204: error: template argument 3 is invalid
prog.cpp:174:211: error: template argument 2 is invalid
using do_transform = output_h<EmptyPack, typename transform_h<F, 0, detail::extreme_value<Comparator, detail::sequence_size<Packs>::value...>::value, typename detail::empty_pack<Packs...>::type, Packs...>::type>;
^
prog.cpp:176:45: error: ‘auto’ parameter not permitted in this context
template <typename EmptyPack, template <auto...> class F, typename... Packs>
^~~
prog.cpp:177:63: error: type/value mismatch at argument 1 in template parameter list for ‘template<template<<typeprefixerror>...<anonymous> > class<template-parameter-1-1> > struct functor_wrapper’
struct combine_packs_h<Transform, EmptyPack, functor_wrapper<F>, Packs...> : do_transform<EmptyPack, less_than, F, Packs...> {};
^
prog.cpp:177:63: note: expected a template of type ‘template<<typeprefixerror>...<anonymous> > class<template-parameter-1-1>’, got ‘template<<typeprefixerror>...<anonymous> > class F’
prog.cpp:177:74: error: template argument 3 is invalid
struct combine_packs_h<Transform, EmptyPack, functor_wrapper<F>, Packs...> : do_transform<EmptyPack, less_than, F, Packs...> {};
^
prog.cpp:177:90: error: expected template-name before ‘<’ token
struct combine_packs_h<Transform, EmptyPack, functor_wrapper<F>, Packs...> : do_transform<EmptyPack, less_than, F, Packs...> {};
^
prog.cpp:179:45: error: ‘auto’ parameter not permitted in this context
template <typename EmptyPack, template <auto...> class F, typename... Packs>
^~~
prog.cpp:180:68: error: type/value mismatch at argument 1 in template parameter list for ‘template<template<<typeprefixerror>...<anonymous> > class<template-parameter-1-1> > struct functor_wrapper’
struct combine_packs_h<TransformToEnd, EmptyPack, functor_wrapper<F>, Packs...> : do_transform<EmptyPack, greater_than, F, Packs...> {};
^
prog.cpp:180:68: note: expected a template of type ‘template<<typeprefixerror>...<anonymous> > class<template-parameter-1-1>’, got ‘template<<typeprefixerror>...<anonymous> > class F’
prog.cpp:180:79: error: template argument 3 is invalid
struct combine_packs_h<TransformToEnd, EmptyPack, functor_wrapper<F>, Packs...> : do_transform<EmptyPack, greater_than, F, Packs...> {};
^
prog.cpp:180:95: error: expected template-name before ‘<’ token
struct combine_packs_h<TransformToEnd, EmptyPack, functor_wrapper<F>, Packs...> : do_transform<EmptyPack, greater_than, F, Packs...> {};
^
prog.cpp: In instantiation of ‘struct detail::sequence_traits<Z<0, 1, 2, 3> >’:
prog.cpp:36:9: required from ‘struct detail::sequence_traits<Z<0, 1, 2, 3>, Q<4, 5, 6>, R<> >’
prog.cpp:197:121: required from ‘struct combine_packs<(CombineType)0u, Z<0, 1, 2, 3>, Q<4, 5, 6>, R<> >’
prog.cpp:221:50: required from here
prog.cpp:36:9: error: invalid use of incomplete type ‘struct detail::sequence_traits<Z<0, 1, 2, 3> >’
struct sequence_traits<First, Rest...> : sequence_traits<First> {};
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cpp:36:9: note: declaration of ‘struct detail::sequence_traits<Z<0, 1, 2, 3> >’
prog.cpp: In instantiation of ‘struct combine_packs<(CombineType)0u, Z<0, 1, 2, 3>, Q<4, 5, 6>, R<> >’:
prog.cpp:221:50: required from here
prog.cpp:197:121: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2, 3>, Q<4, 5, 6>, R<> >’
using EmptyPack = std::conditional_t<LastPackIsEmpty, Last, typename detail::sequence_traits<Packs...>::template_empty>; // Change this if first pack is a Functor
^
prog.cpp:198:90: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2, 3>, Q<4, 5, 6>, R<> >’
using pack = combine_packs_h<C, EmptyPack, typename detail::simple_pack<Packs>::type...>;
^
prog.cpp:199:90: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2, 3>, Q<4, 5, 6>, R<> >’
using meta = std::conditional_t<LastPackIsEmpty, typename remove_last<pack>::type, pack>;
^
prog.cpp: In function ‘int main()’:
prog.cpp:223:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp: In instantiation of ‘struct combine_packs<(CombineType)0u, Z<0, 1, 2, 3>, Z<4, 5, 6> >’:
prog.cpp:226:45: required from here
prog.cpp:197:121: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2, 3>, Z<4, 5, 6> >’
using EmptyPack = std::conditional_t<LastPackIsEmpty, Last, typename detail::sequence_traits<Packs...>::template_empty>; // Change this if first pack is a Functor
^
prog.cpp:198:90: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2, 3>, Z<4, 5, 6> >’
using pack = combine_packs_h<C, EmptyPack, typename detail::simple_pack<Packs>::type...>;
^
prog.cpp:199:90: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2, 3>, Z<4, 5, 6> >’
using meta = std::conditional_t<LastPackIsEmpty, typename remove_last<pack>::type, pack>;
^
prog.cpp:228:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp: In instantiation of ‘struct combine_packs<(CombineType)0u, Z<0, 1, 2, 3>, Q<4, 5, 6>, R<7, 8> >’:
prog.cpp:231:53: required from here
prog.cpp:197:121: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2, 3>, Q<4, 5, 6>, R<7, 8> >’
using EmptyPack = std::conditional_t<LastPackIsEmpty, Last, typename detail::sequence_traits<Packs...>::template_empty>; // Change this if first pack is a Functor
^
prog.cpp:198:90: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2, 3>, Q<4, 5, 6>, R<7, 8> >’
using pack = combine_packs_h<C, EmptyPack, typename detail::simple_pack<Packs>::type...>;
^
prog.cpp:199:90: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2, 3>, Q<4, 5, 6>, R<7, 8> >’
using meta = std::conditional_t<LastPackIsEmpty, typename remove_last<pack>::type, pack>;
^
prog.cpp:233:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp: In instantiation of ‘constexpr const bool combine_packs<(CombineType)0u, std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul> >::LastPackIsEmpty’:
prog.cpp:197:121: required from ‘struct combine_packs<(CombineType)0u, std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul> >’
prog.cpp:236:53: required from here
prog.cpp:196:24: error: incomplete type ‘detail::is_empty<std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul> >’ used in nested name specifier
static constexpr bool LastPackIsEmpty = detail::is_empty<Last>::value;
^~~~~~~~~~~~~~~
prog.cpp:238:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp: In instantiation of ‘constexpr const bool combine_packs<(CombineType)0u, std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul>, std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul> >::LastPackIsEmpty’:
prog.cpp:197:121: required from ‘struct combine_packs<(CombineType)0u, std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul>, std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul> >’
prog.cpp:241:81: required from here
prog.cpp:196:24: error: incomplete type ‘detail::is_empty<std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul> >’ used in nested name specifier
static constexpr bool LastPackIsEmpty = detail::is_empty<Last>::value;
^~~~~~~~~~~~~~~
prog.cpp:243:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp: In instantiation of ‘struct detail::sequence_traits<detail::simple_pack<std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul> >::Q<4ul, 5ul, 6ul> >’:
prog.cpp:36:9: required from ‘struct detail::sequence_traits<detail::simple_pack<std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul> >::Q<4ul, 5ul, 6ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 7ul, 8ul> >::Q<7ul, 8ul>, I<> >’
prog.cpp:138:8: required from ‘struct combine_packs_h<(CombineType)0u, std::integer_sequence<long unsigned int>, detail::simple_pack<std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul> >::Q<0ul, 1ul, 2ul, 3ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul> >::Q<4ul, 5ul, 6ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 7ul, 8ul> >::Q<7ul, 8ul>, I<> >’
prog.cpp:200:34: required from ‘struct combine_packs<(CombineType)0u, std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul>, std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul>, std::integer_sequence<long unsigned int, 7ul, 8ul>, I<> >’
prog.cpp:246:112: required from here
prog.cpp:36:9: error: invalid use of incomplete type ‘struct detail::sequence_traits<detail::simple_pack<std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul> >::Q<4ul, 5ul, 6ul> >’
struct sequence_traits<First, Rest...> : sequence_traits<First> {};
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cpp:36:9: note: declaration of ‘struct detail::sequence_traits<detail::simple_pack<std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul> >::Q<4ul, 5ul, 6ul> >’
prog.cpp: In instantiation of ‘struct combine_packs_h<(CombineType)0u, std::integer_sequence<long unsigned int>, detail::simple_pack<std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul> >::Q<0ul, 1ul, 2ul, 3ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul> >::Q<4ul, 5ul, 6ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 7ul, 8ul> >::Q<7ul, 8ul>, I<> >’:
prog.cpp:200:34: required from ‘struct combine_packs<(CombineType)0u, std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul>, std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul>, std::integer_sequence<long unsigned int, 7ul, 8ul>, I<> >’
prog.cpp:246:112: required from here
prog.cpp:138:8: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<detail::simple_pack<std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul> >::Q<4ul, 5ul, 6ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 7ul, 8ul> >::Q<7ul, 8ul>, I<> >’
struct combine_packs_h<Merge, EmptyPack, First, Rest...> : combine_packs_h<Merge, EmptyPack, First, typename combine_packs_h<Merge, typename detail::sequence_traits<Rest...>::template_empty, Rest...>::type> {};
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cpp: In instantiation of ‘struct combine_packs<(CombineType)0u, std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul>, std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul>, std::integer_sequence<long unsigned int, 7ul, 8ul>, I<> >’:
prog.cpp:246:112: required from here
prog.cpp:200:34: error: no type named ‘type’ in ‘using meta = std::conditional_t<false, combine_packs_h<(CombineType)0u, std::integer_sequence<long unsigned int>, detail::simple_pack<std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul> >::Q<0ul, 1ul, 2ul, 3ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul> >::Q<4ul, 5ul, 6ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 7ul, 8ul> >::Q<7ul, 8ul> >, combine_packs_h<(CombineType)0u, std::integer_sequence<long unsigned int>, detail::simple_pack<std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul> >::Q<0ul, 1ul, 2ul, 3ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul> >::Q<4ul, 5ul, 6ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 7ul, 8ul> >::Q<7ul, 8ul>, I<> > > {aka struct combine_packs_h<(CombineType)0u, std::integer_sequence<long unsigned int>, detail::simple_pack<std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul> >::Q<0ul, 1ul, 2ul, 3ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul> >::Q<4ul, 5ul, 6ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 7ul, 8ul> >::Q<7ul, 8ul>, I<> >}’
using type = typename meta::type;
^
prog.cpp:248:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp: In instantiation of ‘constexpr const bool combine_packs<(CombineType)0u, std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul>, I<4ul, 5ul, 6ul>, std::integer_sequence<long unsigned int, 7ul, 8ul>, std::integer_sequence<long unsigned int> >::LastPackIsEmpty’:
prog.cpp:197:121: required from ‘struct combine_packs<(CombineType)0u, std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul>, I<4ul, 5ul, 6ul>, std::integer_sequence<long unsigned int, 7ul, 8ul>, std::integer_sequence<long unsigned int> >’
prog.cpp:251:125: required from here
prog.cpp:196:24: error: incomplete type ‘detail::is_empty<std::integer_sequence<long unsigned int> >’ used in nested name specifier
static constexpr bool LastPackIsEmpty = detail::is_empty<Last>::value;
^~~~~~~~~~~~~~~
prog.cpp:253:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp: In instantiation of ‘constexpr const bool combine_packs<(CombineType)0u, std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul>, I<4ul, 5ul, 6ul>, I<7ul, 8ul>, std::integer_sequence<long unsigned int, 9ul> >::LastPackIsEmpty’:
prog.cpp:197:121: required from ‘struct combine_packs<(CombineType)0u, std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul>, I<4ul, 5ul, 6ul>, I<7ul, 8ul>, std::integer_sequence<long unsigned int, 9ul> >’
prog.cpp:256:95: required from here
prog.cpp:196:24: error: incomplete type ‘detail::is_empty<std::integer_sequence<long unsigned int, 9ul> >’ used in nested name specifier
static constexpr bool LastPackIsEmpty = detail::is_empty<Last>::value;
^~~~~~~~~~~~~~~
prog.cpp:258:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp: In instantiation of ‘struct combine_packs_h<(CombineType)0u, std::integer_sequence<long unsigned int>, detail::simple_pack<std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul> >::Q<0ul, 1ul, 2ul, 3ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul> >::Q<4ul, 5ul, 6ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 7ul, 8ul> >::Q<7ul, 8ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 9ul> >::Q<9ul>, I<> >’:
prog.cpp:200:34: required from ‘struct combine_packs<(CombineType)0u, std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul>, std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul>, std::integer_sequence<long unsigned int, 7ul, 8ul>, std::integer_sequence<long unsigned int, 9ul>, I<> >’
prog.cpp:261:135: required from here
prog.cpp:138:8: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<detail::simple_pack<std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul> >::Q<4ul, 5ul, 6ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 7ul, 8ul> >::Q<7ul, 8ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 9ul> >::Q<9ul>, I<> >’
struct combine_packs_h<Merge, EmptyPack, First, Rest...> : combine_packs_h<Merge, EmptyPack, First, typename combine_packs_h<Merge, typename detail::sequence_traits<Rest...>::template_empty, Rest...>::type> {};
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cpp: In instantiation of ‘struct combine_packs<(CombineType)0u, std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul>, std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul>, std::integer_sequence<long unsigned int, 7ul, 8ul>, std::integer_sequence<long unsigned int, 9ul>, I<> >’:
prog.cpp:261:135: required from here
prog.cpp:200:34: error: no type named ‘type’ in ‘using meta = std::conditional_t<false, combine_packs_h<(CombineType)0u, std::integer_sequence<long unsigned int>, detail::simple_pack<std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul> >::Q<0ul, 1ul, 2ul, 3ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul> >::Q<4ul, 5ul, 6ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 7ul, 8ul> >::Q<7ul, 8ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 9ul> >::Q<9ul> >, combine_packs_h<(CombineType)0u, std::integer_sequence<long unsigned int>, detail::simple_pack<std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul> >::Q<0ul, 1ul, 2ul, 3ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul> >::Q<4ul, 5ul, 6ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 7ul, 8ul> >::Q<7ul, 8ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 9ul> >::Q<9ul>, I<> > > {aka struct combine_packs_h<(CombineType)0u, std::integer_sequence<long unsigned int>, detail::simple_pack<std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul> >::Q<0ul, 1ul, 2ul, 3ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul> >::Q<4ul, 5ul, 6ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 7ul, 8ul> >::Q<7ul, 8ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 9ul> >::Q<9ul>, I<> >}’
using type = typename meta::type;
^
prog.cpp:263:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp: In instantiation of ‘constexpr const bool combine_packs<(CombineType)0u, I<0ul, 1ul, 2ul, 3ul>, I<4ul, 5ul, 6ul>, I<7ul, 8ul>, I<9ul>, std::integer_sequence<long unsigned int> >::LastPackIsEmpty’:
prog.cpp:197:121: required from ‘struct combine_packs<(CombineType)0u, I<0ul, 1ul, 2ul, 3ul>, I<4ul, 5ul, 6ul>, I<7ul, 8ul>, I<9ul>, std::integer_sequence<long unsigned int> >’
prog.cpp:266:95: required from here
prog.cpp:196:24: error: incomplete type ‘detail::is_empty<std::integer_sequence<long unsigned int> >’ used in nested name specifier
static constexpr bool LastPackIsEmpty = detail::is_empty<Last>::value;
^~~~~~~~~~~~~~~
prog.cpp: In instantiation of ‘struct detail::sequence_traits<I<0ul, 1ul, 2ul, 3ul> >’:
prog.cpp:36:9: required from ‘struct detail::sequence_traits<I<0ul, 1ul, 2ul, 3ul>, I<4ul, 5ul, 6ul>, I<7ul, 8ul>, I<9ul>, std::integer_sequence<long unsigned int> >’
prog.cpp:197:121: required from ‘struct combine_packs<(CombineType)0u, I<0ul, 1ul, 2ul, 3ul>, I<4ul, 5ul, 6ul>, I<7ul, 8ul>, I<9ul>, std::integer_sequence<long unsigned int> >’
prog.cpp:266:95: required from here
prog.cpp:36:9: error: invalid use of incomplete type ‘struct detail::sequence_traits<I<0ul, 1ul, 2ul, 3ul> >’
struct sequence_traits<First, Rest...> : sequence_traits<First> {};
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cpp:36:9: note: declaration of ‘struct detail::sequence_traits<I<0ul, 1ul, 2ul, 3ul> >’
prog.cpp: In instantiation of ‘struct combine_packs<(CombineType)0u, I<0ul, 1ul, 2ul, 3ul>, I<4ul, 5ul, 6ul>, I<7ul, 8ul>, I<9ul>, std::integer_sequence<long unsigned int> >’:
prog.cpp:266:95: required from here
prog.cpp:197:121: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<I<0ul, 1ul, 2ul, 3ul>, I<4ul, 5ul, 6ul>, I<7ul, 8ul>, I<9ul>, std::integer_sequence<long unsigned int> >’
using EmptyPack = std::conditional_t<LastPackIsEmpty, Last, typename detail::sequence_traits<Packs...>::template_empty>; // Change this if first pack is a Functor
^
prog.cpp:198:90: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<I<0ul, 1ul, 2ul, 3ul>, I<4ul, 5ul, 6ul>, I<7ul, 8ul>, I<9ul>, std::integer_sequence<long unsigned int> >’
using pack = combine_packs_h<C, EmptyPack, typename detail::simple_pack<Packs>::type...>;
^
prog.cpp:199:90: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<I<0ul, 1ul, 2ul, 3ul>, I<4ul, 5ul, 6ul>, I<7ul, 8ul>, I<9ul>, std::integer_sequence<long unsigned int> >’
using meta = std::conditional_t<LastPackIsEmpty, typename remove_last<pack>::type, pack>;
^
prog.cpp:268:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp: In instantiation of ‘struct combine_packs<(CombineType)1u, Z<0, 1, 2, 3>, Z<4, 5, 6>, Z<7, 8>, Z<9> >’:
prog.cpp:271:67: required from here
prog.cpp:197:121: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2, 3>, Z<4, 5, 6>, Z<7, 8>, Z<9> >’
using EmptyPack = std::conditional_t<LastPackIsEmpty, Last, typename detail::sequence_traits<Packs...>::template_empty>; // Change this if first pack is a Functor
^
prog.cpp:198:90: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2, 3>, Z<4, 5, 6>, Z<7, 8>, Z<9> >’
using pack = combine_packs_h<C, EmptyPack, typename detail::simple_pack<Packs>::type...>;
^
prog.cpp:199:90: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2, 3>, Z<4, 5, 6>, Z<7, 8>, Z<9> >’
using meta = std::conditional_t<LastPackIsEmpty, typename remove_last<pack>::type, pack>;
^
prog.cpp:273:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp: In instantiation of ‘struct combine_packs<(CombineType)1u, Z<0, 1, 2, 3>, Q<4, 5, 6>, Z<7, 8>, R<9> >’:
prog.cpp:276:67: required from here
prog.cpp:197:121: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2, 3>, Q<4, 5, 6>, Z<7, 8>, R<9> >’
using EmptyPack = std::conditional_t<LastPackIsEmpty, Last, typename detail::sequence_traits<Packs...>::template_empty>; // Change this if first pack is a Functor
^
prog.cpp:198:90: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2, 3>, Q<4, 5, 6>, Z<7, 8>, R<9> >’
using pack = combine_packs_h<C, EmptyPack, typename detail::simple_pack<Packs>::type...>;
^
prog.cpp:199:90: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2, 3>, Q<4, 5, 6>, Z<7, 8>, R<9> >’
using meta = std::conditional_t<LastPackIsEmpty, typename remove_last<pack>::type, pack>;
^
prog.cpp:278:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp: In instantiation of ‘constexpr const bool combine_packs<(CombineType)1u, std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul>, std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul>, I<7ul, 8ul>, std::integer_sequence<long unsigned int, 9ul> >::LastPackIsEmpty’:
prog.cpp:197:121: required from ‘struct combine_packs<(CombineType)1u, std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul>, std::integer_sequence<long unsigned int, 4ul, 5ul, 6ul>, I<7ul, 8ul>, std::integer_sequence<long unsigned int, 9ul> >’
prog.cpp:281:121: required from here
prog.cpp:196:24: error: incomplete type ‘detail::is_empty<std::integer_sequence<long unsigned int, 9ul> >’ used in nested name specifier
static constexpr bool LastPackIsEmpty = detail::is_empty<Last>::value;
^~~~~~~~~~~~~~~
prog.cpp:283:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp: In instantiation of ‘struct combine_packs<(CombineType)1u, Z<0, 1, 2, 3>, Z<4, 5, 6>, Z<7, 8>, Z<9>, Q<> >’:
prog.cpp:286:72: required from here
prog.cpp:197:121: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2, 3>, Z<4, 5, 6>, Z<7, 8>, Z<9>, Q<> >’
using EmptyPack = std::conditional_t<LastPackIsEmpty, Last, typename detail::sequence_traits<Packs...>::template_empty>; // Change this if first pack is a Functor
^
prog.cpp:198:90: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2, 3>, Z<4, 5, 6>, Z<7, 8>, Z<9>, Q<> >’
using pack = combine_packs_h<C, EmptyPack, typename detail::simple_pack<Packs>::type...>;
^
prog.cpp:199:90: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2, 3>, Z<4, 5, 6>, Z<7, 8>, Z<9>, Q<> >’
using meta = std::conditional_t<LastPackIsEmpty, typename remove_last<pack>::type, pack>;
^
prog.cpp:288:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp: In instantiation of ‘struct combine_packs<(CombineType)1u, std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul>, I<4ul, 5ul, 6ul>, Z<7, 8>, std::integer_sequence<long unsigned int, 9ul>, I<> >’:
prog.cpp:291:108: required from here
prog.cpp:200:34: error: no type named ‘type’ in ‘using meta = std::conditional_t<false, combine_packs_h<(CombineType)1u, std::integer_sequence<long unsigned int>, detail::simple_pack<std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul> >::Q<0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul>, I<4ul, 5ul, 6ul>, Z<7, 8>, detail::simple_pack<std::integer_sequence<long unsigned int, 9ul> >::Q<9ul> >, combine_packs_h<(CombineType)1u, std::integer_sequence<long unsigned int>, detail::simple_pack<std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul> >::Q<0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul>, I<4ul, 5ul, 6ul>, Z<7, 8>, detail::simple_pack<std::integer_sequence<long unsigned int, 9ul> >::Q<9ul>, I<> > > {aka struct combine_packs_h<(CombineType)1u, std::integer_sequence<long unsigned int>, detail::simple_pack<std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul> >::Q<0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul>, I<4ul, 5ul, 6ul>, Z<7, 8>, detail::simple_pack<std::integer_sequence<long unsigned int, 9ul> >::Q<9ul>, I<> >}’
using type = typename meta::type;
^
prog.cpp:293:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp: In instantiation of ‘constexpr const bool combine_packs<(CombineType)1u, std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul>, R<4, 5, 6>, Z<7, 8>, I<9ul>, std::integer_sequence<long unsigned int> >::LastPackIsEmpty’:
prog.cpp:197:121: required from ‘struct combine_packs<(CombineType)1u, std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul>, R<4, 5, 6>, Z<7, 8>, I<9ul>, std::integer_sequence<long unsigned int> >’
prog.cpp:296:121: required from here
prog.cpp:196:24: error: incomplete type ‘detail::is_empty<std::integer_sequence<long unsigned int> >’ used in nested name specifier
static constexpr bool LastPackIsEmpty = detail::is_empty<Last>::value;
^~~~~~~~~~~~~~~
prog.cpp:298:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp: In instantiation of ‘struct detail::sequence_traits<Z<0, 1, 2> >’:
prog.cpp:36:9: required from ‘struct detail::sequence_traits<Z<0, 1, 2>, Z<3, 4, 5>, Z<6, 7, 8> >’
prog.cpp:197:121: required from ‘struct combine_packs<(CombineType)2u, Z<0, 1, 2>, Z<3, 4, 5>, Z<6, 7, 8> >’
prog.cpp:301:57: required from here
prog.cpp:36:9: error: invalid use of incomplete type ‘struct detail::sequence_traits<Z<0, 1, 2> >’
struct sequence_traits<First, Rest...> : sequence_traits<First> {};
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cpp:36:9: note: declaration of ‘struct detail::sequence_traits<Z<0, 1, 2> >’
prog.cpp: In instantiation of ‘struct combine_packs<(CombineType)2u, Z<0, 1, 2>, Z<3, 4, 5>, Z<6, 7, 8> >’:
prog.cpp:301:57: required from here
prog.cpp:197:121: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2>, Z<3, 4, 5>, Z<6, 7, 8> >’
using EmptyPack = std::conditional_t<LastPackIsEmpty, Last, typename detail::sequence_traits<Packs...>::template_empty>; // Change this if first pack is a Functor
^
prog.cpp:198:90: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2>, Z<3, 4, 5>, Z<6, 7, 8> >’
using pack = combine_packs_h<C, EmptyPack, typename detail::simple_pack<Packs>::type...>;
^
prog.cpp:199:90: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2>, Z<3, 4, 5>, Z<6, 7, 8> >’
using meta = std::conditional_t<LastPackIsEmpty, typename remove_last<pack>::type, pack>;
^
prog.cpp:303:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp: In instantiation of ‘struct combine_packs<(CombineType)2u, Z<0, 1, 2>, Q<3, 4>, R<5, 6, 7, 8, 9, 10> >’:
prog.cpp:306:62: required from here
prog.cpp:197:121: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2>, Q<3, 4>, R<5, 6, 7, 8, 9, 10> >’
using EmptyPack = std::conditional_t<LastPackIsEmpty, Last, typename detail::sequence_traits<Packs...>::template_empty>; // Change this if first pack is a Functor
^
prog.cpp:198:90: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2>, Q<3, 4>, R<5, 6, 7, 8, 9, 10> >’
using pack = combine_packs_h<C, EmptyPack, typename detail::simple_pack<Packs>::type...>;
^
prog.cpp:199:90: error: no type named ‘template_empty’ in ‘struct detail::sequence_traits<Z<0, 1, 2>, Q<3, 4>, R<5, 6, 7, 8, 9, 10> >’
using meta = std::conditional_t<LastPackIsEmpty, typename remove_last<pack>::type, pack>;
^
prog.cpp:308:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp: In instantiation of ‘constexpr const bool combine_packs<(CombineType)2u, std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul>, I<3ul, 4ul>, std::integer_sequence<long unsigned int, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul> >::LastPackIsEmpty’:
prog.cpp:197:121: required from ‘struct combine_packs<(CombineType)2u, std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul>, I<3ul, 4ul>, std::integer_sequence<long unsigned int, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul> >’
prog.cpp:311:98: required from here
prog.cpp:196:24: error: incomplete type ‘detail::is_empty<std::integer_sequence<long unsigned int, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul> >’ used in nested name specifier
static constexpr bool LastPackIsEmpty = detail::is_empty<Last>::value;
^~~~~~~~~~~~~~~
prog.cpp:313:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp: In instantiation of ‘struct combine_packs_h<(CombineType)2u, std::integer_sequence<long unsigned int>, detail::simple_pack<std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul> >::Q<0ul, 1ul, 2ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 3ul, 4ul> >::Q<3ul, 4ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul> >::Q<5ul, 6ul, 7ul, 8ul, 9ul, 10ul>, I<> >’:
prog.cpp:200:34: required from ‘struct combine_packs<(CombineType)2u, std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul>, std::integer_sequence<long unsigned int, 3ul, 4ul>, std::integer_sequence<long unsigned int, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul>, I<> >’
prog.cpp:316:121: required from here
prog.cpp:158:8: error: invalid use of incomplete type ‘struct interlace<detail::simple_pack<std::integer_sequence<long unsigned int> >::Q<>, detail::simple_pack<std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul> >::Q<0ul, 1ul, 2ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 3ul, 4ul> >::Q<3ul, 4ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul> >::Q<5ul, 6ul, 7ul, 8ul, 9ul, 10ul>, I<> >’
struct combine_packs_h<Interlace, EmptyPack, Packs...> : output_h<EmptyPack, typename interlace<typename detail::simple_pack<EmptyPack>::type, Packs...>::type> {};
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cpp:146:54: note: declaration of ‘struct interlace<detail::simple_pack<std::integer_sequence<long unsigned int> >::Q<>, detail::simple_pack<std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul> >::Q<0ul, 1ul, 2ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 3ul, 4ul> >::Q<3ul, 4ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul> >::Q<5ul, 6ul, 7ul, 8ul, 9ul, 10ul>, I<> >’
template <typename Output, typename... Packs> struct interlace;
^~~~~~~~~
prog.cpp: In instantiation of ‘struct combine_packs<(CombineType)2u, std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul>, std::integer_sequence<long unsigned int, 3ul, 4ul>, std::integer_sequence<long unsigned int, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul>, I<> >’:
prog.cpp:316:121: required from here
prog.cpp:200:34: error: no type named ‘type’ in ‘using meta = std::conditional_t<false, combine_packs_h<(CombineType)2u, std::integer_sequence<long unsigned int>, detail::simple_pack<std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul> >::Q<0ul, 1ul, 2ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 3ul, 4ul> >::Q<3ul, 4ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul> >::Q<5ul, 6ul, 7ul, 8ul, 9ul, 10ul> >, combine_packs_h<(CombineType)2u, std::integer_sequence<long unsigned int>, detail::simple_pack<std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul> >::Q<0ul, 1ul, 2ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 3ul, 4ul> >::Q<3ul, 4ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul> >::Q<5ul, 6ul, 7ul, 8ul, 9ul, 10ul>, I<> > > {aka struct combine_packs_h<(CombineType)2u, std::integer_sequence<long unsigned int>, detail::simple_pack<std::integer_sequence<long unsigned int, 0ul, 1ul, 2ul> >::Q<0ul, 1ul, 2ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 3ul, 4ul> >::Q<3ul, 4ul>, detail::simple_pack<std::integer_sequence<long unsigned int, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul> >::Q<5ul, 6ul, 7ul, 8ul, 9ul, 10ul>, I<> >}’
using type = typename meta::type;
^
prog.cpp:318:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp:321:47: error: type/value mismatch at argument 1 in template parameter list for ‘template<template<<typeprefixerror>...<anonymous> > class<template-parameter-1-1> > struct functor_wrapper’
combine_packs<Transform, functor_wrapper<foo>, Z<2,4,-2,6,2,2,2>, Z<5,10,-5,15>, Z<1,2,-1,3,1>>::type,
^
prog.cpp:321:47: note: expected a template of type ‘template<<typeprefixerror>...<anonymous> > class<template-parameter-1-1>’, got ‘template<int A, int B, int C> struct foo’
prog.cpp:321:96: error: template argument 2 is invalid
combine_packs<Transform, functor_wrapper<foo>, Z<2,4,-2,6,2,2,2>, Z<5,10,-5,15>, Z<1,2,-1,3,1>>::type,
^~
prog.cpp:323:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp:326:52: error: type/value mismatch at argument 1 in template parameter list for ‘template<template<<typeprefixerror>...<anonymous> > class<template-parameter-1-1> > struct functor_wrapper’
combine_packs<TransformToEnd, functor_wrapper<foo>, Z<2,4,-2,6,2,2,2>, Z<5,10,-5,15>, Z<1,2,-1,3,1>>::type,
^
prog.cpp:326:52: note: expected a template of type ‘template<<typeprefixerror>...<anonymous> > class<template-parameter-1-1>’, got ‘template<int A, int B, int C> struct foo’
prog.cpp:326:101: error: template argument 2 is invalid
combine_packs<TransformToEnd, functor_wrapper<foo>, Z<2,4,-2,6,2,2,2>, Z<5,10,-5,15>, Z<1,2,-1,3,1>>::type,
^~
prog.cpp:328:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp:331:47: error: type/value mismatch at argument 1 in template parameter list for ‘template<template<<typeprefixerror>...<anonymous> > class<template-parameter-1-1> > struct functor_wrapper’
combine_packs<Transform, functor_wrapper<foo>, Q<2,4,-2,6,2,2,2>, Z<5,10,-5,15>, R<1,2,-1,3,1>>::type,
^
prog.cpp:331:47: note: expected a template of type ‘template<<typeprefixerror>...<anonymous> > class<template-parameter-1-1>’, got ‘template<int A, int B, int C> struct foo’
prog.cpp:331:96: error: template argument 2 is invalid
combine_packs<Transform, functor_wrapper<foo>, Q<2,4,-2,6,2,2,2>, Z<5,10,-5,15>, R<1,2,-1,3,1>>::type,
^~
prog.cpp:333:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp:336:52: error: type/value mismatch at argument 1 in template parameter list for ‘template<template<<typeprefixerror>...<anonymous> > class<template-parameter-1-1> > struct functor_wrapper’
combine_packs<TransformToEnd, functor_wrapper<foo>, Z<2,4,-2,6,2,2,2>, Q<5,10,-5,15>, R<1,2,-1,3,1>, R<>>::type,
^
prog.cpp:336:52: note: expected a template of type ‘template<<typeprefixerror>...<anonymous> > class<template-parameter-1-1>’, got ‘template<int A, int B, int C> struct foo’
prog.cpp:336:106: error: template argument 2 is invalid
combine_packs<TransformToEnd, functor_wrapper<foo>, Z<2,4,-2,6,2,2,2>, Q<5,10,-5,15>, R<1,2,-1,3,1>, R<>>::type,
^~
prog.cpp:338:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp:341:47: error: type/value mismatch at argument 1 in template parameter list for ‘template<template<<typeprefixerror>...<anonymous> > class<template-parameter-1-1> > struct functor_wrapper’
combine_packs<Transform, functor_wrapper<foo>, std::index_sequence<2,4,-2,6,2,2,2>, std::index_sequence<5,10,-5,15>, std::index_sequence<1,2,-1,3,1>>::type,
^
prog.cpp:341:47: note: expected a template of type ‘template<<typeprefixerror>...<anonymous> > class<template-parameter-1-1>’, got ‘template<int A, int B, int C> struct foo’
prog.cpp:341:150: error: template argument 2 is invalid
combine_packs<Transform, functor_wrapper<foo>, std::index_sequence<2,4,-2,6,2,2,2>, std::index_sequence<5,10,-5,15>, std::index_sequence<1,2,-1,3,1>>::type,
^~
prog.cpp:343:2: error: template argument 1 is invalid
>::value << '\n'; // true
^
prog.cpp:346:52: error: type/value mismatch at argument 1 in template parameter list for ‘template<template<<typeprefixerror>...<anonymous> > class<template-parameter-1-1> > struct functor_wrapper’
combine_packs<TransformToEnd, functor_wrapper<foo>, std::index_sequence<2,4,-2,6,2,2,2>, I<5,10,-5,15>, std::index_sequence<1,2,-1,3,1>, I<>>::type,
^
prog.cpp:346:52: note: expected a template of type ‘template
stdout