std::chrono...operator++,(3)
π std::chrono...operator++,(3) π
okay so this page is from the C++ Standard Libary manual β yes, that spelling is literally on the header and we are not fixing it, bestie π
. It's all about the increment and decrement operators on std::chrono::time_point, and it is giving very "one tick at a time" energy. let's get into it π¦
πΈ NAME πΈ
std::chrono::time_point::operator++, -
std::chrono::time_point::operator++,
π Synopsis π
constexpr time_point& operator++(); (1) (since C++20)
constexpr time_point operator++( int ); (2) (since C++20)
constexpr time_point& operator--(); (3) (since C++20)
constexpr time_point operator--( int ); (4) (since C++20)
okay so the actual move here: it modifies the point in time *this represents by one tick of the duration. that's the whole gig β¨
If d_ is a member variable holding the duration (i.e., time since epoch) of this time_point object:
- 1) Equivalent to
++d_; return *this;. - 2) Equivalent to
return time_point(d_++). - 3) Equivalent to
--d_; return *this;. - 4) Equivalent to
return time_point(d_--);.
π« Parameters π«
(none) β literally none, bestie. not a single parameter in sight π
π Return value π
1,3)A reference to thistime_pointafter modification.2,4)A copy of thetime_pointmade before modification.
π§ͺ Example π§ͺ
This section is incomplete Reason: no example
crying, shaking, throwing up β no example yet π
π See also π
operator++operator++(int)β increments or decrements the tick countoperator--β (public member function ofstd::chrono::duration<Rep,Period>)operator--(int)operator+=β modifies the time point by the given durationoperator-=β (public member function)operator+β performs add and subtract operations involving a time pointoperator-β (function template)(C++11)
π·οΈ Category π·οΈ
- Todo no example
mwah π β this one's sourced from http://cppreference.com, dated 2024.06.10, on the std::chrono...operator++,(3) page. bye bestie π«Ά
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms