std::literals::chrono_literals(3cxx)

🌸 NAME 🌸

std::literals::chrono_literals β€” bestie, this is the 3cxx manual page for the chrono literal-suffix namespace. It's giving time math, but make it fashion πŸ’…βœ¨

✨ SYNOPSIS ✨

🫢 Functions

  • template<char... _Digits> constexpr chrono::hours operator''h () β€” literal suffix for durations of type std::chrono::hours. Hour gang πŸ‘‘
  • constexpr chrono::duration< long double, ratio< 3600, 1 > > operator''h (long double __hours) β€” literal suffix for durations representing non-integer hours. Yes, floating-point hours are a thing, slay 🌈
  • template<char... _Digits> constexpr chrono::minutes operator''min () β€” literal suffix for durations of type std::chrono::minutes. Minute bestie energy πŸŽ€
  • constexpr chrono::duration< long double, ratio< 60, 1 > > operator''min (long double __mins) β€” literal suffix for durations representing non-integer minutes. Non-integer minutes, iconic πŸ¦‹
  • template<char... _Digits> constexpr chrono::milliseconds operator''ms () β€” literal suffix for durations of type std::chrono::milliseconds. Milli moment ⭐
  • constexpr chrono::duration< long double, milli > operator''ms (long double __msecs) β€” literal suffix for durations representing non-integer milliseconds. Tiny time, big vibe πŸ’œ
  • template<char... _Digits> constexpr chrono::nanoseconds operator''ns () β€” literal suffix for durations of type std::chrono::nanoseconds. Nano era, no cap πŸ”₯
  • constexpr chrono::duration< long double, nano > operator''ns (long double __nsecs) β€” literal suffix for durations representing non-integer nanoseconds. So smol 🧚
  • template<char... _Digits> constexpr chrono::seconds operator''s () β€” literal suffix for durations of type std::chrono::seconds. Second squad πŸ‘‘
  • constexpr chrono::duration< long double > operator''s (long double __secs) β€” literal suffix for durations representing non-integer seconds. Floating seconds, okayyy 🌸
  • template<char... _Digits> constexpr chrono::microseconds operator''us () β€” literal suffix for durations of type std::chrono::microseconds. Micro bestie πŸ’–
  • constexpr chrono::duration< long double, micro > operator''us (long double __usecs) β€” literal suffix for durations representing non-integer microseconds. Micro but make it float ✨

πŸ’– Detailed Description πŸ’–

This is the ISO C++ 2014 namespace for suffixes for duration literals. Obsessed.

These suffixes can be used to create chrono::duration values with tick periods of hours, minutes, seconds, milliseconds, microseconds or nanoseconds. For example, std::chrono::seconds(5) can be written as 5s after making the suffix visible in the current scope. The suffixes can be made visible by a using-directive or using-declaration such as:

  • using namespace std::chrono_literals;
  • using namespace std::literals;
  • using namespace std::chrono;
  • using namespace std;
  • using std::chrono_literals::operator''s;

The result of these suffixes on an integer literal is one of the standard typedefs such as std::chrono::hours. The result on a floating-point literal is a duration type with the specified tick period and an unspecified floating-point representation, for example 1.5e2ms might be equivalent to chrono::duration<long double, chrono::milli>(1.5e2). Literally so specific and so mysterious 🫢

⏳ Since ⏳

C+14 β€” yes, exactly like that on the page, bestie. I am not editing the canon 😭

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code.


That's the whole page, bestie 🫢. Footer/source-version realness: libstdc+std::literals::chrono_literals(3cxx) β€” and there is no date shown on this page, so the date is literally MIA 😭. Mwah πŸ’‹

πŸ“¦ where this page comes from