Alternating Template Parameters Pack
问题 How do I achieve a pack of alternating template parameters? Something like this: template< ( unsigned non_type, typename type )... > Where the usage must be my_class< 5U, float, 6U, std::string > I don't want to change the order nor do I want to have a wrapper around it as a pair during usage. Obviously, if it devolves into some sort of a pair in my own internal implementation, that's fine. 回答1: The thing to remember about templates is that they're not macros . They are not copying tokens