Код: Выделить всё
std::cout
Приведенные выше отпечатки: < /p>
|-----------------------------File Information------------------------------|
< /code>
У меня много разных типов заливок и ширины выравнивания. Я решил сделать несколько вспомогательных функций: < /p>
constexpr static
std::string_view
headerCenter(const std::string& text, const int width, const char fill) {
// build fmt string
const std::string_view format = "{:" + 'fill' + '^' + toascii(width) + '}';
return fmt::format(format, text);
}
< /code>
Я получил эту ошибку во время компиляции: < /p>
Constexpr function never produces a constant expression
Подробнее здесь: https://stackoverflow.com/questions/722 ... s-with-fmt