std::chrono...operator++,(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

🌈 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 this time_point after modification.
  • 2,4) A copy of the time_point made 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 count
  • operator-- β€” (public member function of std::chrono::duration<Rep,Period>)
  • operator--(int)
  • operator+= β€” modifies the time point by the given duration
  • operator-= β€” (public member function)
  • operator+ β€” performs add and subtract operations involving a time point
  • operator- β€” (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