如果我这样做了
std::copy(source, source + size, destination);
我有强大的异常安全保证吗? IE。如果 std::copy 抛出,destination 保持不变?
最佳答案
附录 E:标准库异常安全来自 Stroustrop 的 C++ 编程语言 是 freely viewable from his website .
由此而来:
The
copy()
algorithm (§18.6.1) does not offer the strong exception-safety guarantee. It does not guarantee that it will leave its target unchanged if an exception is thrown during copying
关于C++ STL 的 copy() 异常安全,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29016785/