proxygen
folly::chrono::detail Namespace Reference

Classes

struct  is_duration
 
struct  is_duration< std::chrono::duration< Rep, Period > >
 

Functions

template<typename To , typename Duration >
constexpr To ceil_impl (Duration const &d, To const &t)
 
template<typename To , typename Duration >
constexpr To floor_impl (Duration const &d, To const &t)
 
template<typename To , typename Diff >
constexpr To round_impl (To const &t0, To const &t1, Diff diff0, Diff diff1)
 
template<typename To , typename Duration >
constexpr To round_impl (Duration const &d, To const &t0, To const &t1)
 
template<typename To , typename Duration >
constexpr To round_impl (Duration const &d, To const &t0)
 

Function Documentation

template<typename To , typename Duration >
constexpr To folly::chrono::detail::ceil_impl ( Duration const &  d,
To const &  t 
)

Definition at line 59 of file Chrono.h.

References folly::pushmi::detail::t.

Referenced by folly::chrono::ceil().

59  {
60  return t < d ? t + To{1} : t;
61 }
template<typename To , typename Duration >
constexpr To folly::chrono::detail::floor_impl ( Duration const &  d,
To const &  t 
)

Definition at line 64 of file Chrono.h.

References folly::pushmi::detail::t.

Referenced by folly::chrono::floor().

64  {
65  return t > d ? t - To{1} : t;
66 }
template<typename To , typename Diff >
constexpr To folly::chrono::detail::round_impl ( To const &  t0,
To const &  t1,
Diff  diff0,
Diff  diff1 
)

Definition at line 69 of file Chrono.h.

Referenced by folly::chrono::round().

69  {
70  return diff0 < diff1 ? t0 : diff1 < diff0 ? t1 : t0.count() & 1 ? t1 : t0;
71 }
template<typename To , typename Duration >
constexpr To folly::chrono::detail::round_impl ( Duration const &  d,
To const &  t0,
To const &  t1 
)

Definition at line 74 of file Chrono.h.

References round_impl().

74  {
75  return round_impl(t0, t1, d - t0, t1 - d);
76 }
constexpr To round_impl(Duration const &d, To const &t0)
Definition: Chrono.h:79
template<typename To , typename Duration >
constexpr To folly::chrono::detail::round_impl ( Duration const &  d,
To const &  t0 
)

Definition at line 79 of file Chrono.h.

References type, and value.

Referenced by round_impl().

79  {
80  return round_impl(d, t0, t0 + To{1});
81 }
constexpr To round_impl(Duration const &d, To const &t0)
Definition: Chrono.h:79