std::chrono::ceil(std::chrono::duration)
Std::Time::Ceil%28 std::Time::Time%29
Defined in header | | |
---|---|---|
template <class ToDuration, class Rep, class Period> constexpr ToDuration ceil(const duration<Rep, Period>& d | | (since C++17) |
返回最小持续时间。t
可在ToDuration
大于等于d
...
该函数不参与重载解析,除非ToDuration
是std::chrono::duration
...
参数
d | - | duration to convert |
---|
返回值
d
舍入到类型的持续时间ToDuration
...
可能的实施
模板<class T>结构是[医]持续时间:STD::false[医]类型{};模板<类Rep,类周期>结构是[医]持续时间<std::time::time<rep,time>>:std::true[医]类型{};模板<类到,类Rep,类周期,类=启用[医]如果[医]T<IS[医]持续时间<To>{}>>conexpr to ceil%28 const std::chrono::time<rep,期>&d%29{to t=std::chrono::工期[医]铸造<To>%28d%29;如果%28t<d%29返回t+到{1};返回t;}
*。
例
另见
duration_cast | converts a duration to another, with a different tick interval (function template) |
---|---|
floor(std::chrono::duration) (C++17) | converts a duration to another, rounding down (function template) |
round(std::chrono::duration) (C++17) | converts a duration to another, rounding to nearest, ties to even (function template) |
ceil(std::chrono::time_point) (C++17) | converts a time_point to another, rounding up (function template) |
ceil | nearest integer not less than the given value (function) |
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。