FMT не смог компилироваться при форматировании перевода после обновления до V10 и вышеC++

Программы на C++. Форум разработчиков
Ответить Пред. темаСлед. тема
Anonymous
 FMT не смог компилироваться при форматировании перевода после обновления до V10 и выше

Сообщение Anonymous »

Учитывая код, который был успешно скомпилирован с FMT v9.1, но не удался с FMT v10+
Он споткнул меня некоторое время, прежде чем я обнаружил проблемы Github с правильными ключевыми словами enum и компиляцией . Также проблемы GitHub не указывают версию в заголовке ..

Это определенное поведение для FMT V10+< /p>
#include
#include
#include
using Test = enum Test_e{
A,B,C
};

int main(int, char **)
{
fmt::print(std::cout, "test enum {}\n", A);
}
< /code>
Когда Libfmt обновлен до V10.0, после появления сообщений об ошибках. />[*]https://github.com/fmtlib/fmt/issues/3720
[*]https://github.com/fmtlib/fmt/issues/3671

ошибка msg for c+stri 11

msg for c+stri 11
msg for c+>In file included from :2:
/opt/compiler-explorer/libs/fmt/10.0.0/include/fmt/core.h: In instantiation of 'fmt::v10::detail::value fmt::v10::detail::make_value(T&&) [with Context = fmt::v10::basic_format_context; T = Test_e&]':
/opt/compiler-explorer/libs/fmt/10.0.0/include/fmt/core.h:1711:29: required from 'fmt::v10::detail::value fmt::v10::detail::make_arg(T&&) [with bool IS_PACKED = true; Context = fmt::v10::basic_format_context; type = fmt::v10::detail::type::custom_type; T = Test_e&; typename std::enable_if::type = 0]'
/opt/compiler-explorer/libs/fmt/10.0.0/include/fmt/core.h:1827:77: required from 'fmt::v10::format_arg_store::format_arg_store(T&& ...) [with T = {Test_e&}; Context = fmt::v10::basic_format_context; Args = {Test_e}]'
/opt/compiler-explorer/libs/fmt/10.0.0/include/fmt/core.h:1844:31: required from 'constexpr fmt::v10::format_arg_store fmt::v10::make_format_args(T&& ...) [with Context = basic_format_context; T = {Test_e&}]'
/opt/compiler-explorer/libs/fmt/10.0.0/include/fmt/ostream.h:179:44: required from 'void fmt::v10::print(std::ostream&, format_string, T&& ...) [with T = {Test_e}; std::ostream = std::basic_ostream; format_string = basic_format_string]'
:10:15: required from here
/opt/compiler-explorer/libs/fmt/10.0.0/include/fmt/core.h:1691:7: error: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter specialization: https://fmt.dev/latest/api.html#udt
1691 | formattable,
| ^~~~~~~~~~~
/opt/compiler-explorer/libs/fmt/10.0.0/include/fmt/core.h:1691:7: note: 'formattable' evaluates to false
Compiler returned: 1


Подробнее здесь: https://stackoverflow.com/questions/777 ... -and-above
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «C++»