STD::CHRONO::HH_MM_SS(3cxx)

πŸ’– NAME πŸ’–

std::chrono::hh_mm_ss< _Duration > β€” that's the class, bestie, and this page is from the manual called 3cxx. It's the utility for splitting a duration into hours, minutes, and seconds. Periodt. ✨

✨ SYNOPSIS ✨

First things first, include the header:

#include <chrono>

πŸŽ€ Public Types πŸŽ€

  • precision β€” here's the full declaration, verbatim:
using precision = duration< common_type_t< typename _Duration::rep,
    chrono::seconds::rep >, ratio< 1,
    __detail::__pow10(fractional_width)> >

πŸ’… Public Member Functions πŸ’…

  • constexpr hh_mm_ss (_Duration __d) β€” the constructor: hand it a _Duration __d and it's ready to do its split-up thing. 🫢
  • constexpr chrono::hours hours () const noexcept β€” the hours accessor, const and noexcept, living its best life.
  • constexpr bool is_negative () const noexcept β€” the negative-check accessor, also const noexcept.
  • constexpr chrono::minutes minutes () const noexcept β€” the minutes accessor. Slay.
  • constexpr operator precision () const noexcept β€” conversion operator to precision, const noexcept.
  • constexpr chrono::seconds seconds () const noexcept β€” the seconds accessor.
  • constexpr precision subseconds () const noexcept β€” the subseconds accessor, returning precision.
  • constexpr precision to_duration () const noexcept β€” the to_duration accessor, returning precision.

πŸ¦‹ Static Public Attributes πŸ¦‹

  • static constexpr unsigned fractional_width β€” yup, a static constexpr unsigned named fractional_width. Iconic.

🌈 Friends 🌈

  • template<typename > struct __detail::__utc_leap_second β€” this template struct is the friend. Note the little space after typename; we keep it exactly. 🫢

πŸ’œ Detailed Description πŸ’œ

Here's the class declaration vibe:

template<typename _Duration>
class std::chrono::hh_mm_ss< _Duration >

The raw page has a tiny Doxygen quirk: a stray " sitting right before Utility for splitting a duration into hours, minutes, and seconds. We keep the chaos. πŸŒ€

This is a convenience type that provides accessors for the constituent parts (hours, minutes, seconds and subseconds) of a duration. It's giving "split the duration, bestie." πŸ’…

Since: C++20 β€” no cap.

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code. πŸ€–βœ¨


Final sign-off: the footer's source/version + date line, with libstdc++ and the 3cxx manual name doing their thing β€” mwah πŸ’‹.

πŸ“¦ where this page comes from