I would like to populate an array of enum using constexpr. The content of the array follows a certain pattern.
I have an enum separating ASCII character set into fou
Ignoring ALL the issues, indices to the rescue:
template struct seq{};
template
struct gen_seq : gen_seq{};
template
struct gen_seq<0, Is...> : seq{};
template
constexpr Table MagicFunction(seq){
return {{ whichCategory(Is)... }};
}
constexpr Table MagicFunction(){
return MagicFunction(gen_seq<128>{});
}
Live example.