STD::CHRONO::TIME_POINT(3cxx)

πŸ’– NAME πŸ’–

okay so this is std::chrono::time_point< _Clock, _Dur > from the 3cxx manual, and bestie, it is literally the glow-up of "when did this happen" β€” chrono::time_point represents a point in time as measured by a clock ✨ no cap.


✨ SYNOPSIS ✨

πŸŽ€ Public Types

the little name-tags it carries around, all four of them, periodt:

typedef _Clock clock
typedef _Dur duration
typedef duration::period period
typedef duration::rep rep

πŸ’… Public Member Functions

here's the whole roster, i'm not skipping a single one because every one of them is a main character:

constexpr time_point (const duration &__dur)
template<typename _Dur2 , typename  = _Require<is_convertible<_Dur2,
    _Dur>>> constexpr time_point (const time_point< clock, _Dur2 > &__t)
constexpr time_point & operator++ ()
constexpr time_point operator++ (int)
constexpr time_point & operator+= (const duration &__dur)
constexpr time_point & operator-- ()
constexpr time_point operator-- (int)
constexpr time_point & operator-= (const duration &__dur)
constexpr duration time_since_epoch () const

like… two constructors (one taking a const duration &__dur, one templated on _Dur2 doing the is_convertible vibe check and converting from a time_point< clock, _Dur2 >), then the full ++/-- quartet β€” prefix forms handing back time_point &, postfix forms handing back a plain time_point β€” the += / -= pair taking a const duration &__dur, and time_since_epoch () which is const and returns a duration. every single one is constexpr, slay πŸ”₯

🌸 Static Public Member Functions

the two extremes, both static, both constexpr, both noexcept β€” icons only:

static constexpr time_point max () noexcept
static constexpr time_point min () noexcept
heads up bestie β€” (Note that these are not member symbols.) πŸ™ˆ

so yes, this one lives outside the class, iykyk:

template<typename _Clock , typename _Dur1 , typename _Rep2 ,
    typename _Period2 > constexpr time_point< _Clock, typename
    common_type< _Dur1, duration< _Rep2, _Period2 > >::type >
    operator+ (const time_point< _Clock, _Dur1 > &__lhs, const
    duration< _Rep2, _Period2 > &__rhs)

it's the operator+ that takes a const time_point< _Clock, _Dur1 > &__lhs plus a const duration< _Rep2, _Period2 > &__rhs and returns a time_point< _Clock, typename common_type< _Dur1, duration< _Rep2, _Period2 > >::type >. the common_type there is doing the friend-group-matching between your two durations, honestly iconic πŸ’…


🌟 Detailed Description 🌟

template<typename _Clock, typename _Dur>
    class std::chrono::time_point< _Clock, _Dur >"chrono::time_point
    represents a point in time as measured by a clock

that's the whole flex 🫢 β€” template on _Clock and _Dur, and it represents a point in time as measured by a clock. that's the entire thesis. ate and left no crumbs.


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code. (yes the robots wrote it, not me 😭)


and that's the whole page, bestie πŸŽ€ this was the std::chrono::time_point< _Clock, _Dur >(3cxx) page out of the libstdc++ docs, generated automatically by Doxygen from the source code, footer and all β€” go forth and timestamp things πŸ’œπŸ¦‹

πŸ“¦ where this page comes from