std::literals(3)
β¨ std::literals β¨
okay bestie, welcome to std::literals β that's the ISO C++ inline namespace where all the cute literal suffixes live. yes, the 3 in std::literals(3) means it's a library functions manual page, and yes, we're gonna go through every single one of these suffixes together. no skimming, no skipping. π
πΈ NAME πΈ
std::literals β ISO C++ inline namespace for literal suffixes. that's it, that's the whole vibe. it's giving "tiny namespace, enormous power". π
π¦ SYNOPSIS π¦
π Namespaces
namespace chrono_literals
π Functions
constexpr chrono::day operator''d (unsigned long long __d) noexceptβ literal suffix for creatingchrono::dayobjects.template<char... _Digits> constexpr chrono::hours operator''h ()β literal suffix for durations of typestd::chrono::hours.constexpr chrono::duration< long double, ratio< 3600, 1 > > operator''h (long double __hours)β literal suffix for durations representing non-integer hours.template<char... _Digits> constexpr chrono::minutes operator''min ()β literal suffix for durations of typestd::chrono::minutes.constexpr chrono::duration< long double, ratio< 60, 1 > > operator''min (long double __mins)β literal suffix for durations representing non-integer minutes.template<char... _Digits> constexpr chrono::milliseconds operator''ms ()β literal suffix for durations of typestd::chrono::milliseconds.constexpr chrono::duration< long double, milli > operator''ms (long double __msecs)β literal suffix for durations representing non-integer milliseconds.template<char... _Digits> constexpr chrono::nanoseconds operator''ns ()β literal suffix for durations of typestd::chrono::nanoseconds.constexpr chrono::duration< long double, nano > operator''ns (long double __nsecs)β literal suffix for durations representing non-integer nanoseconds.template<char... _Digits> constexpr chrono::seconds operator''s ()β literal suffix for durations of typestd::chrono::seconds.constexpr chrono::duration< long double > operator''s (long double __secs)β literal suffix for durations representing non-integer seconds.constexpr basic_string_view< char > operator''sv (const char *__str, size_t __len) noexceptconstexpr basic_string_view< char16_t > operator''sv (const char16_t *__str, size_t __len) noexceptconstexpr basic_string_view< char32_t > operator''sv (const char32_t *__str, size_t __len) noexceptconstexpr basic_string_view< wchar_t > operator''sv (const wchar_t *__str, size_t __len) noexcepttemplate<char... _Digits> constexpr chrono::microseconds operator''us ()β literal suffix for durations of typestd::chrono::microseconds.constexpr chrono::duration< long double, micro > operator''us (long double __usecs)β literal suffix for durations representing non-integer microseconds.constexpr chrono::year operator''y (unsigned long long __y) noexceptβ literal suffix for creatingchrono::yearobjects.
π Detailed Description π
ISO C++ inline namespace for literal suffixes.
like, that's literally the whole thing. it's an inline namespace, it holds the literal suffixes, and the compiler pulls them into scope so you can write stuff like 42s and have it mean something. iconic behavior honestly. β¨
π Author π
generated automatically by Doxygen for libstdc++ from the source code. so no human author to thank here β the robots did it, and they ate. π₯
okay bestie that's the whole page!! π this one came from the libstdc++ manual set and it lives at page std::literals(3) β go forth and suffix responsibly. mwah. π«Ά
π¦ where this page comes from
- arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
- fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 44: libstdc++-docs 16.2.1-2.fc44
- fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms