b2bcf3b68a
If the move can fail, so can most likely the copy. Use of move_if_noexcept() therefore trades a faster potentially-throwing operation for a slower potentially-throwing operation. It is true that a throwing move ctor may leave the source object in a partially-formed state while the copy ctor may not (exceptions prove the rule, hello auto_ptr), but we shouldn't pessimize lazy coders (missing noexcept) to cater for borderline-buggy code (throwing move ctor that doesn't provide the strong exception guarantee). Yes, you can construct such situations (and something as simple as std::array<std::pmr::string, 10> is already affected), but we don't cater for these anywhere else in Qt, so why do it here? Change-Id: I728af8e87ed86f24326530f704a48df1f728ac98 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> |
||
---|---|---|
.github/workflows | ||
bin | ||
cmake | ||
coin | ||
config.tests | ||
dist | ||
doc | ||
examples | ||
lib | ||
libexec | ||
LICENSES | ||
mkspecs | ||
qmake | ||
src | ||
tests | ||
util | ||
.cmake.conf | ||
.gitattributes | ||
.gitignore | ||
.lgtm.yml | ||
.tag | ||
CMakeLists.txt | ||
conanfile.py | ||
config_help.txt | ||
configure | ||
configure.bat | ||
configure.cmake | ||
dependencies.yaml | ||
qt_cmdline.cmake | ||
sync.profile |