Код: Выделить всё
#include
#include
inline constexpr std::string TestFunc(int length = 1) {
std::string ret;
//ret.reserve(16);
for (int i = 0; i < length; i++) {
ret.append(1, ' ');
}
return ret;
}
int main(int argc, char**) {
static constexpr std::string test = TestFunc(15);
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79903390/c-constexpr-string-length-too-long[/url]
Мобильная версия