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

时间:2018-06-30 11:01:37   收藏:0   阅读:1938

安装:
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 以及指定链接库和头文件位置  

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!