fmtlib / fmt

A modern formatting library
https://fmt.dev
Other
20.76k stars 2.5k forks source link

Don't know how to resolve this issue #3471

Closed mabodx closed 1 year ago

mabodx commented 1 year ago
/home/runner/work/cytester2/cytester2/vcpkg/installed/x64-linux/include/fmt/core.h:2561:10: error: call to deleted constructor of 'formatter<mapped_type, char_type>' (aka 'formatter<std::atomic<unsigned long>, char>')
  return formatter<mapped_type, char_type>().parse(ctx);
         ^
/home/runner/work/cytester2/cytester2/vcpkg/installed/x64-linux/include/fmt/core.h:2620:23: note: in instantiation of function template specialization 'fmt::detail::parse_format_specs<std::atomic<unsigned long>, fmt::detail::compile_parse_context<char>>' requested here
        parse_funcs_{&parse_format_specs<Args, parse_context_type>...},
                      ^
/home/runner/work/cytester2/cytester2/vcpkg/installed/x64-linux/include/fmt/core.h:[276](https://github.com/MoreChickenDelivered/cytester2/actions/runs/5138265281/jobs/9247401120#step:11:277)9:47: note: in instantiation of member function 'fmt::detail::format_string_checker<char, char[11], const char *, int, std::atomic<unsigned long>>::format_string_checker' requested here
      detail::parse_format_string<true>(str_, checker(s));
                                              ^
/home/runner/work/cytester2/cytester2/live_strategies/../cppsdk/live_operator.h:1293:15: note: in instantiation of function template specialization 'fmt::basic_format_string<char, const char (&)[11], const char *, int, std::atomic<unsigned long> &>::basic_format_string<char[41], 0>' requested here
              WARN("ratelimit_streak_count: {:d}", ratelimit_streak_count);
              ^
/home/runner/work/cytester2/cytester2/build/_deps/liblogger-src/logutil/logutil.h:217:29: note: expanded from macro 'WARN'
    logger.Warn(fmt::format("[{}:{}:{}]: " _fmt, __func__,         \
                            ^
/home/runner/work/cytester2/cytester2/live_strategies/../cppsdk/live_operator.h:505:15: note: in instantiation of member function 'live_operator::LiveOperator<executors::PluginExecutor>::sendOrders' requested here
        this->sendOrders();
              ^
/home/runner/work/cytester2/cytester2/live_strategies/../cppsdk/live_operator.h:384:11: note: in instantiation of member function 'live_operator::LiveOperator<executors::PluginExecutor>::setupSubscriptions' requested here
    this->setupSubscriptions(config);
          ^
/home/runner/work/cytester2/cytester2/live_strategies/plugin_live.h:22:11: note: in instantiation of member function 'live_operator::LiveOperator<executors::PluginExecutor>::setupConfig' requested here
    this->setupConfig(config_filename);
          ^
/home/runner/work/cytester2/cytester2/vcpkg/installed/x64-linux/include/fmt/core.h:792:3: note: 'formatter' has been explicitly marked deleted here
  formatter() = delete;
  ^
In file included from /home/runner/work/cytester2/cytester2/live_strategies/live_strategy.cpp:11:
In file included from /home/runner/work/cytester2/cytester2/live_strategies/plugin_live.h:10:
/home/runner/work/cytester2/cytester2/live_strategies/../cppsdk/live_operator.h:1293:15: error: call to consteval function 'fmt::basic_format_string<char, const char (&)[11], const char *, int, std::atomic<unsigned long> &>::basic_format_string<char[41], 0>' is not a constant expression
              WARN("ratelimit_streak_count: {:d}", ratelimit_streak_count);
              ^
vitaut commented 1 year ago

{fmt} doesn't provide a formatter for std::atomic (yet) so you should load it explicitly:

WARN("ratelimit_streak_count: {:d}", ratelimit_streak_count.load());