I can create constexpr std :: array:
constexpr std::array<int,5> values {1,2,3,4,5};
It works great. But I can not create constexpr vector:
constexpr std::vector<int> vec = {1,2,3,4,5};
This gives me an error:
the type 'const std::vector<int>' of constexpr variable 'vec' is not literal constexpr std::vector<int> vec = {1,2,3,4,5};
source share