Reputation: 655
I'm wondering what version of gcc I need to use new std::chrono::from_stream
. I'm on 10.1.0
but the compiler doesn't know the name. I don't see any trace of the feature on the GNU cxx status page. Thank you!
#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
Upvotes: 3
Views: 1370
Reputation: 219335
Your link is for the C++ compiler status. Here is the status of the gcc std::lib. As I write this, it isn't implemented yet (though I'm aware work has begun).
Until it is available, here is a free, open-source preview of this part of C++20. from_stream
(and parse
) are in namespace date
instead of namespace std::chrono
, and in the header date.h
.
Upvotes: 4