Can std::array be used in a constexpr class?

后端 未结 2 2072

I am currently creating a class with a constexpr constructor and I wonder if I can use an std::array to store the data of this class. Does the stan

2条回答
  •  旧巷少年郎
    2020-12-10 11:28

    Because std::array is an aggregate, it can be initialized as a constexpr if and only if the underlying type T has a constexpr constructor (when presented with each initializer you provide).

提交回复
热议问题