开发者

What is the rationale for renaming monotonic_clock to steady_clock in <chrono>?

开发者_C百科

Why did the committee rename monotonic_clock to steady_clock? Vendors are providing monotonic_clock for backwards compatibility so I expect monotonic_clock will linger for a while.

It just seems a bit early to deprecate something in C++0x. ;) Edit: The committe has the right and responsibility to rename components the best they can before release as was done in this case.

I don't see the big benefit of the rename.


N3128 is the proposal that did so and includes the rationale:

The implementation of the timeout definition necessarily depends on a steady clock, one that cannot be adjusted. A monotonic clock is not sufficient. While one could be implicit in the standard, below we make one explicit.

Given a steady clock, the monotonic clock seems to be of marginal utility, and we replace the monotonic clock with the steady clock.

monotonic_clock wasn't deprecated. It was removed prior to standardization. The draft standard is subject to change right up until it is voted to FDIS. And this is one of those changes. Living on the draft (the bleeding edge) is great, but one must accept the risks of doing so.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜