c++ fmt 库安装和使用示例


安装:
1 git clone  https://github.com/fmtlib/fmt.git
2. cmake .
3. make && make install 
#include "fmt/format.h"
#include <iostream>
int main()
{
        std::string s = fmt::format("{0}is{1}", "abra",12);
        std::cout << s <<std::endl;
        return 0;
}
编译选项要使用 -std=c++11  -lfmt 以及指定链接库和头文件位置  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM