std::stack::operator=(3)
π NAME π
std::stack::operator= β std::stack::operator=
okay bestie, welcome to the std::stack::operator= page from the C++ Standard Libary manual β yes, that spelling is the manual name in the header, and we respect it π
. This whole page is about the assignment operator for std::stack, and itβs lowkey just: replace the contents of the container adaptor with the contents of the argument. Letβs go π«Ά
β¨ Synopsis β¨
stack& operator=( const stack& other ); (1) (implicitly declared)
stack& operator=( stack&& other ); (2) (since C++11)
(implicitly declared)
So whatβs the vibe? The assignment operator replaces the contents of the container adaptor with the contents of the given argument. Thatβs the whole assignment moment β¨
- Copy assignment operator. Replaces the contents with a copy of the contents of
other. Effectively callsc = other.c;. - Move assignment operator. Replaces the contents with those of
otherusing move semantics. Effectively callsc = std::move(other.c);.
Both are marked (implicitly declared) in the synopsis, and number 2 is (since C++11) β periodt π
π Parameters π
otherβ another container adaptor to be used as source
thatβs the source, bestie π«Ά
πΈ Return value πΈ
*this
thatβs it, thatβs the return π
π¦ Complexity π¦
- 1, 2) β Equivalent to that of
operator=of the underlying container.
both numbers, same energy β¨
π Example π
This section is incomplete.
Reason: no example.
(yes, bestie, the example section is literally telling us thereβs no example β not me staring at the void π)
π See also π
constructorβ constructs the stack (public member function)
π§ Category π§
- Todo: no example
mwah π β source: http://cppreference.com; version/date: 2024.06.10; page: std::stack::operator=(3). byeee π«Άβ¨
π¦ 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