我試圖編譯使用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