aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-08-28 09:39:47 -0400
committerLioncash <mathew1800@gmail.com>2018-08-28 09:39:50 -0400
commitf1bc62bb4c962de530c22d2a1e73d33cdc85ea92 (patch)
treefbb78d5f80ff9fca9362ba226bf4a9416baf235b /src/core/hle/kernel/kernel.cpp
parentffe2336136dc683b8d97a355c2446aad2aaa5905 (diff)
hle/result: Make ResultVal's move constructor as noexcept
Many containers within the standard library provide different behaviors based on whether or not a move constructor/assignment operator can be guaranteed not to throw or not. Notably, implementations will generally use std::move_if_noexcept (or an internal implementation of it) to provide strong exception guarantees. If a move constructor potentially throws (in other words, is not noexcept), then certain behaviors will create copies, rather than moving the values. For example, consider std::vector. When a std::vector calls resize(), there are two ways the elements can be relocated to the new block of memory (if a reallocation happens), by copy, or by moving the existing elements into the new block of memory. If a type does not have a guarantee that it will not throw in the move constructor, a copy will happen. However, if it can be guaranteed that the move constructor won't throw, then the elements will be moved. This just allows ResultVal to be moved instead of copied all the time if ever used in conjunction with containers for whatever reason.
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
0 files changed, 0 insertions, 0 deletions