#include <iostream>
#include <map>
namespace teaflow {
template<std::size_t...> struct seq{
void pint() {
std::cout << "origin seq" << std::endl;
}
};
template<int N, int... Is>
struct CE : CE<N-1, N, Is...>{
};
template<int... N>
struct CE<0, N...> : seq<N...> {
void pint() {
std::cout << "0" << std::endl;
}
};
template<int... N>
struct CE<1, 2, N...> : seq<N...> {
void pint() {
std::cout << "1 2" << std::endl;
}
};
template<int... N>
struct CE<1, 1, N...> : seq<N...> {
void pint() {
std::cout << "1 1" << std::endl;
}
};
}
int main() {
teaflow::CE<3> cc;
cc.pint();
teaflow::CE<1> c2;
c2.pint();
teaflow::CE<1, 1> c3;
c3.pint();
return 0;
}
輸出結果:
1 2
0
1 1