C++ 错误:‘;标准:字符格式’;尚未申报

C++ 错误:‘;标准:字符格式’;尚未申报,c++,C++,我的代码的最小部分如下所示: #include <charconv> #include <string_view> #include <cmath> int main() { return 0; } double strparse(std::string_view s, int field, int a, int b) { double candidates[3]; auto format = std::chars_format:

我的代码的最小部分如下所示:

#include <charconv>
#include <string_view>
#include <cmath>

int main() {

    return 0;
}

double strparse(std::string_view s, int field, int a, int b) {
    double candidates[3];
    auto format = std::chars_format::fixed;
    return 0;
}
使用g++9.2.1

返回:

bob.cpp: In function ‘double strparse(std::string_view, int, int, int)’:
bob.cpp:12:24: error: ‘std::chars_format’ has not been declared
   12 |     auto format = std::chars_format::fixed;
      |                        ^~~~~~~~~~~~
我不知道为什么这不是编译-有人能帮忙吗


您有什么版本的g++?您的标准库(libstdc++)的版本是什么?编辑了我的问题。使用g++9.2.1和libstdc++.so.6像GCC和clang这样的书只有部分支持:(搜索P0067R5)它在MSVC上工作,最新的clang和GCC失败
bob.cpp: In function ‘double strparse(std::string_view, int, int, int)’:
bob.cpp:12:24: error: ‘std::chars_format’ has not been declared
   12 |     auto format = std::chars_format::fixed;
      |                        ^~~~~~~~~~~~