// Select stuff - templates that define selection of one out of four types (4ed, page 792). struct Nil {}; // A trivial Nil type // select - declared, but not defined in the general case. Only specializations are defined. template struct select; // A using alias Select that binds unused types to Nil template using Select = typename select::type; // Specializations for 0-3 template struct select<0, T1, T2, T3, T4> {using type = T1;}; // Specialization for 0 template struct select<1, T1, T2, T3, T4> {using type = T2;}; // Specialization for 1 template struct select<2, T1, T2, T3, T4> {using type = T3;}; // Specialization for 2 template struct select<3, T1, T2, T3, T4> {using type = T4;}; // Specialization for 3