【发布时间】:2020-08-09 23:33:47
【问题描述】:
在一个相关问题 ("std::string formatting like sprintf") 中,我了解到这个很棒的新 C++20 标头 <format>。
但是,there seems to be no supporting compiler。这是正确的还是有办法使用它?
我正在使用带有 -std=c++2a 标志的 g++ 9.3,并且无法识别库 <format>。
#include <format> // fatal error: format: No such file or directory
#include <iostream>
int main(){
std::cout << std::format("Hello {}!", "World");
}
g++-9 test.cpp -o test -std=c++2a
【问题讨论】:
标签: c++ formatting g++ header-files c++20