Can a stack have an exception safe method for returning and removing the top element with move seman
- by Motti
In an answer to a question about std::stack::pop() I claimed that the reason pop does not return the value is for exception safety reason (what happens if the copy constructor throws).
@Konrad commented that now with move semantics this is no longer relevant. Is this true?
AFAIK, move constructors can throw, but perhaps with noexcept it can still be achieved.
For bonus points what thread safety guarantees can this operation supply?