简体   繁体   English

将 monotonic_clock 重命名为 stable_clock 的理由是什么<chrono> ?</chrono>

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

Why did the committee rename monotonic_clock to steady_clock?为什么委员会将 monotonic_clock 重命名为 stable_clock? Vendors are providing monotonic_clock for backwards compatibility so I expect monotonic_clock will linger for a while.供应商正在提供 monotonic_clock 以实现向后兼容性,因此我预计 monotonic_clock 会持续一段时间。

It just seems a bit early to deprecate something in C++0x.在 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: N3128是这样做的提案,其中包括理由:

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. monotonic_clock没有被弃用。 It was removed prior to standardization.它在标准化之前被删除。 The draft standard is subject to change right up until it is voted to FDIS.标准草案在提交给 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.生活在草案(最前沿)上很棒,但必须接受这样做的风险。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM