std::chrono...::operator=(3)

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

πŸ’… NAME πŸ’…

Okay so this is the std::chrono...::operator=(3) page, bestie, and the main character is std::chrono::zoned_time::operator= β€” the assignment operator, fr fr. It assigns stuff, it slays, it has three whole overloads. πŸ’–


✨ Synopsis ✨

zoned_time& operator=( const zoned_time& other ) = default;

(1) (since C++20)

zoned_time& operator=( const std::chrono::sys_time<Duration>& other );

(2) (since C++20)

zoned_time& operator=( const std::chrono::local_time<Duration>& other );

(3) (since C++20)

Assign the value of other to *this. That's the whole vibe check. 🫢

  1. Defaulted copy assignment operator. Copy-assigns both the stored time point and the stored time zone pointer. zoned_time has no move assignment operator; a move is a copy. Not me finding out a move is just a copy 😭
  2. Assigns other to the stored time point. The time zone pointer is unchanged. After this call, get_sys_time() == other. Lowkey clean, no cap.
  3. Converts other to a std::chrono::sys_time as if by zone->to_sys(other) (where zone is the non-static data member holding the stored time zone pointer) and assigns the result to the stored time point. The time zone pointer is unchanged. After this call, get_local_time() == other. The way that conversion eats and leaves the time zone pointer alone β€” iconic. πŸ’…

🫢 Return value 🫢

*this β€” that's it, that's the whole return value, periodt. πŸ‘‘


mwah πŸ’– source: http://cppreference.com Β· version/date: 2024.06.10 Β· page: std::chrono...::operator=(3) β€” no cap, that's the whole footer, bestie. πŸŽ€

πŸ“¦ where this page comes from