c++ - std::chrono::from_stream gcc 可用性,在 gcc 10.1.0 中不可用

标签 c++ gcc c++20

我想知道我需要使用新的 gcc 版本 std::chrono::from_stream 。我使用的是 10.1.0,但编译器不知道该名称。我在 GNU cxx status page 上没有看到该功能的任何痕迹。谢谢!

#include <chrono>
std::chrono::from_stream(stream, "%Y-%m-%d %H:%M:%S", timeDuration);


 error: no member named 'from_stream' in namespace 'std::chrono' [clang-diagnostic-error]
     std::chrono::from_stream(stream, "%Y-%m-%d %H:%M:%S", timeDuration);


# g++ --version
g++ (GCC) 10.1.0

最佳答案

Your link用于 C++ 编译器状态。 Here is the status of the gcc std::lib 。当我写这篇文章时,它还没有实现(尽管我知道工作已经开始)。

在可用之前,here is a free, open-source preview of this part of C++20from_stream(和 parse)位于命名空间 date 中,而不是命名空间 std::chrono 中,并且位于 header date.h.

关于c++ - std::chrono::from_stream gcc 可用性,在 gcc 10.1.0 中不可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68865833/

相关文章:

c++ - Oprofile 与 perf

c++ - 无法弄清楚为什么头文件中的私有(private)成员在 cpp 文件中不起作用

c++ - 在决定通过引用还是通过值时,尺寸真的是一个问题吗?

c++ - 使用 noexcept 作为 lambda 修饰符或参数约束

c - 指向嵌套结构的指针

gcc - 解释 gcc 映射文件

c - 为什么在执行 C 程序时出现错误,显示终端中没有此类目录?

c++ - 为什么不允许优化器折叠 "constant context"?

c++ - 理解 c++20 的用户定义字符串文字加法

c++ - C++结构:强制初始化成员?