Static arrays at compile time in C++

后端 未结 3 1347
囚心锁ツ
囚心锁ツ 2021-02-03 16:21

I was wondering if its possible to make the following answer more generic, in the sense that the type of the array be templated instead of just unsigned:

I\'ve enclosed

3条回答
  •  清歌不尽
    2021-02-03 16:56

    I don't think the expression like 'template ' is a valid usage of C++11 variadic templates.

    It can be of two forms as I understand:

    1. template : variable number of generic type parameters
    2. template : variable number of integer(non-type) parameters

    Refer to this wikipedia article for variadic templates.

提交回复
热议问题