1
0
Fork 0
forked from suyu/suyu
suyu/src/core/hle
Lioncash f1bc62bb4c 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.
2018-08-28 09:39:50 -04:00
..
kernel Merge pull request #1177 from lioncash/err 2018-08-27 18:37:48 -04:00
service Merge pull request #1162 from ogniK5377/ttf-plu 2018-08-27 15:43:10 -04:00
ipc.h add IPC CommandType & Some HID FunctionInfo (#487) 2018-05-30 14:09:21 -04:00
ipc_helpers.h kernel: Move object class to its own source files 2018-08-01 23:34:42 -04:00
lock.cpp Fix build on macOS and linux 2018-01-13 22:38:52 +00:00
lock.h Use recursive_mutex instead of mutex to fix #2902 2017-08-29 20:39:55 +12:00
result.h hle/result: Make ResultVal's move constructor as noexcept 2018-08-28 09:39:50 -04:00