我已经使用相关文档定义了以下类型特征结构:
/*!
* @brief Get the type at a given index Idx from a template parameter pack TPack.
*
* Provides a member type holding the type at a given index Idx in a template
* parameter pack TPack.
* <br> The index must be less than the template parameter pack dimension, otherwise
* a compilation error will be triggered.
*
* @ingroup my_group
*/
template <unsigned int Idx, class... TPack>
struct TypeAt;
Run Code Online (Sandbox Code Playgroud)
然后提供了一个方便的别名(在同一个文件和同一个命名空间中定义)为:
/*!
* @ingroup my_group
*/
template<unsigned …Run Code Online (Sandbox Code Playgroud)