C++23
Код: Выделить всё
#include
#include
// Fails to compile if length() > 15 [the default std::string capacity]
constexpr std::string OVERFLOW = "0123456789123456"; // Remove the "6" and it compiles
constexpr std::string SHORT_TEXT = "012345678912345";
int main()
{
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79885062/stdstring-constexpr-fails-to-compile-if-string-length-is-over-the-capacity[/url]
Мобильная версия