2013-08-07 46 views
1

我注意到std::chrono::steady_clock::nowcplusplus.com的文檔中有noexcept說明符。不過,我還沒有在最新的C++ 11草案中找到任何這方面的規定(遺憾的是我沒有這個標準的副本)。應該std :: chrono :: steady_clock ::現在是noexcept?

這是cplusplus.com文檔中的錯誤還是std::chrono::steady_clock::nownoexcept說明符?的steady_clock C++的11個標準的定義的

+0

改爲使用http://en.cppreference.com/作爲參考。 – Snps

+0

使用N3337作爲最接近C++ 11標準的近似值。 –

回答

8

§20.11.7.2:

class steady_clock { 
public: 
    typedef unspecified rep; 
    typedef ratio<unspecified , unspecified > period; 
    typedef chrono::duration<rep, period> duration; 
    typedef chrono::time_point<unspecified, duration> time_point; 
    static const bool is_steady = true; 
    static time_point now() noexcept; 
}; 

所以,是的,std::steady_clock::now()應該noexcept,這是不是文檔中的錯誤。 It seems cppreference says the same

相關問題