std::stack::pop(3)
π std::stack::pop(3) β the C++ Standard Library glow-up
okay bestie, so you know std::stack? This is literally the pop member function, and it's giving "bye bestie, you're not the main character anymore" energy. It's from the C++ Standard Library, and yes, it's a whole mood. Let me break it down for you. π
β¨ Synopsis
void pop();
So the way this works: it removes the top element from the stack. Like, gone, poof, no cap. And effectively, it calls c.pop_back(). That's it. That's the whole vibe. π¦
πΈ Parameters
(none)
literally nothing to pass in. zero. zilch. the void is the parameter. π
π«Ά Return value
(none)
it doesn't give you anything back. it just takes. it's giving "takes your man, takes your car, takes your credit card" but for a stack element. no return, just removal. periodt. π
π₯ Complexity
Equal to the complexity of Container::pop_back.
so however expensive your container's pop_back is, that's how expensive this is. no extra drama, no hidden fees, iykyk. β
π Example
(the original page leaves this space empty β so bestie, there's literally no example here. iconic of them, honestly.)
π See also
emplaceβ constructs element in-place at the top (C++11) (public member function)pushβ inserts element at the top (public member function)topβ accesses the top element (public member function)
these are the sister functions, the entourage, the supporting cast. push puts stuff in, top peeks at what's there, emplace builds it right on top, and pop? pop is the one that kicks it out. main character energy, honestly. π
β¨ π and that's the whole tea, bestie π β¨
this masterpiece of documentation comes to you from C++ Standard Library, dated 2024.06.10, and you can find more at http://cppreference.com. go forth and pop responsibly. π§ββοΈπ
π¦ 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