Код: Выделить всё
template
struct const_lit;
template
struct const_lit{
inline static constexpr unsigned Count = N;
};
struct str {
const char* ptr;
unsigned len;
template requires (const_lit::Count > 0)
str(T&& s) : ptr(s), len(const_lit::Count - 1) {
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79885892/bug-in-gcc-when-use-string-literal-as-const-charn-throught-functor-in-templ[/url]
Мобильная версия