代码之家  ›  专栏  ›  技术社区  ›  Hossein

错误C2661“fmt::v7::print”:没有重载函数接受3个参数

  •  0
  • Hossein  · 技术社区  · 3 年前

    正在尝试:

    fmt::print(fg(fmt::color::red), "A critical error has occured. consult the logs and fix the issue! {0}", std::endl);
    

    结果显示错误消息: Error C2661 'fmt::v7::print': no overloaded function takes 3 arguments
    看官方文件 here fmt::print 作为:

     template <typename S, typename... Args>
    void fmt::print(const text_style &ts, const S &format_str, const Args&... args)
    

    这表明,争论的数量不应该是一个问题,事实上,它不是。如果我替换 std::endl 像这样随机的事情 1 相反,它编译和构建都很好! 这里怎么了?

    1 回复  |  直到 3 年前
        1
  •  3
  •   songyuanyao    3 年前

    std::endl

    fmt::print(fg(fmt::color::red), 
               "A critical error has occured. consult the logs and fix the issue! {0}", 
               std::endl<char, std::char_traits<char>>);
    //                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^