在< chrono&gt ;?中将monotonic_clock重命名为steady_clock的理由是什么? [英] What is the rationale for renaming monotonic_clock to steady_clock in <chrono>?

查看:438
本文介绍了在< chrono&gt ;?中将monotonic_clock重命名为steady_clock的理由是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么委员会将monotonic_clock重命名为steady_clock?
供应商提供的monotonic_clock的向后兼容性,所以我期望monotonic_clock将暂停一段时间。

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.

这似乎有点早就废弃了C ++ 0x 。 ;)
编辑:在这种情况下,committe有权利和责任在发布之前最好地重命名组件。

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

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 不推荐使用。在标准化之前将其除去。标准草案可以更改,直到它被投票给FDIS。这是其中的一个变化。生活在草案(出血的边缘)是伟大的,但人必须接受这样做的风险。

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.

这篇关于在< chrono&gt ;?中将monotonic_clock重命名为steady_clock的理由是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆