Код: Выделить всё
constexpr std::span s = {0,0};
Код: Выделить всё
span.cpp:7:48: error: ‘std::span{((const int*)(&)), std::__detail::__extent_storage{2}}’ is not a constant expression
7 | constexpr std::span s = {0,0};
| ^
span.cpp:7:48: error: ‘std::span(std::initializer_list{((const int*)(& const int [2]{0, 0})), 2})’ is not a constant expression because it refers to an incompletely initialized variable
Подробнее здесь: https://stackoverflow.com/questions/798 ... rs-p2752r3
Мобильная версия