std::stack::pop(3)

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

πŸ’… 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