我试图编译使用GCC this example program(测试版本4.5.1,4.6.3,4.8.4):std :: put_time在GCC中的实现状态?
#include <iostream>
#include <iomanip>
#include <ctime>
#include <chrono>
using std::chrono::system_clock;
int main()
{
system_clock::time_point now = system_clock::now();
std::time_t now_c = system_clock::to_time_t(
now - std::chrono::hours(24));
std::cout << "One day ago, the time was "
<< std::put_time(std::localtime(&now_c), "%F %T") << '\n';
}
prog.cpp: In function 'int main()':
prog.cpp:14:18: error: 'put_time' is not a member of 'std'
我想,也许这不是尚未实施。所以我试图检查这个函数的实现状态。我只找到了这个网页:
但我找不到任何音符put_time
或chrono
或相似。任何人都可以指向一个资源,提供关于这个库的实现状态的信息吗?
GCC 4.9已经发布 - 看起来它不在那里,不是吗? – ollo
@ollo As [Jonathan has confirmed](http://stackoverflow.com/questions/14136833/stdput-time-implementation-status-in-gcc/14137287?noredirect=1#comment35569824_14142342),gcc 4.9仍然缺乏这些功能。 :(是的,那很伤心 – Ali
是的,我刚刚检查了4.9源码,无论如何,谢谢。 – ollo