首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::chrono::floor(std::chrono::time_point)

Defined in header <chrono>

template <class ToDuration, class Clock, class Duration> constexpr time_point<Clock, ToDuration> floor(const time_point<Clock, Duration>& tp);

(since C++17)

返回最大时间点t可在ToDuration较小的或等于tp...

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

参数

tp

-

time point to round down

返回值

d使用类型的持续时间舍入到下一个时间点。ToDuration...

可能的实施

模板<class T>结构是[医]持续时间:STD::false[医]类型{};模板<类Rep,类周期>结构是[医]持续时间<std::time::time<rep,time>>:std::true[医]类型{};模板<class到,类时钟,类FromDuration,class=std::Enable[医]如果[医]T<IS[医]持续时间<To>{}>>std::time::time[医]点<时钟,到>地板%28 const std::time::time[医]点<时钟,倒转>&tp%29{返回std::chrono::time[医]点<时钟,到>{std::time::地板<To>%28 tp.time[医]自[医]EIRCH%28%29%29};}

*。

另见

time_point_cast

converts a time point to another time point on the same clock, with a different duration (function template)

ceil(std::chrono::time_point) (C++17)

converts a time_point to another, rounding up (function template)

round(std::chrono::time_point) (C++17)

converts a time_point to another, rounding to nearest, ties to even (function template)

floor(std::chrono::duration) (C++17)

converts a duration to another, rounding down (function template)

floor

nearest integer not greater than the given value (function)

代码语言:txt
复制
 © cppreference.com

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

扫码关注腾讯云开发者

领取腾讯云代金券