Can I assume that std::swap will not throw when it is used to swap
std::string objects?
In the standard it says that the swap() std::string member function runs
in constant time.
I didn't see anything that said that swapping strings was guaranteed to
not throw though. But it would seem
that a constant time swap ought not to throw though. I can't really see
a way to implement one that does throw without
deliberately sabotaging it at least :)
So can I assume std::swap won't throw for strings?
-Davis
std::string objects?
In the standard it says that the swap() std::string member function runs
in constant time.
I didn't see anything that said that swapping strings was guaranteed to
not throw though. But it would seem
that a constant time swap ought not to throw though. I can't really see
a way to implement one that does throw without
deliberately sabotaging it at least :)
So can I assume std::swap won't throw for strings?
-Davis
Comment