在线文档教程
C++
应用 | Utilities

std::chrono::floor(std::chrono::duration)

Std::Time::楼层%28 std::time::工期%29

Defined in header
template <class ToDuration, class Rep, class Period> constexpr ToDuration floor(const duration<Rep, Period>& d(since C++17)

返回最大持续时间t可在ToDuration小于或等于d...

该函数不参与重载解析,除非ToDurationstd::chrono::duration...

参数

d-duration to convert

返回值

d四舍五入为类型的持续时间ToDuration...

可能的实施

模板<class T>结构是[医]持续时间:STD::false[医]类型{};模板<类Rep,类周期>结构是[医]持续时间<std::time::time<rep,time>>:std::true[医]类型{};模板<class到类,类Rep,类周期,class=std::Enable[医]如果[医]T<IS[医]持续时间<To>{}>到楼层的百分比28持续时间<Rep,期间>&d%29{to t=std::chrono::工期[医]铸造<To>%28d%29;如果%28t>d%29返回t-到{1};返回t;}

*。

另见

duration_castconverts a duration to another, with a different tick interval (function template)
ceil(std::chrono::duration) (C++17)converts a duration to another, rounding up (function template)
round(std::chrono::duration) (C++17)converts a duration to another, rounding to nearest, ties to even (function template)
floor(std::chrono::time_point) (C++17)converts a time_point to another, rounding down (function template)
floornearest integer not greater than the given value (function)

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/rono/time/place