summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Lioncash2019-05-29 02:47:01 -0400
committerGravatar Rodrigo Locatti2019-05-31 04:44:02 -0300
commit1edf018319a7ca7fcc88406f1fd73e180b7c0b63 (patch)
treef9e110a03f3ce287cd7c9a5a6a7eb07948fd2f72
parentMerge pull request #1931 from DarkLordZach/mii-database-1 (diff)
downloadyuzu-1edf018319a7ca7fcc88406f1fd73e180b7c0b63.tar.gz
yuzu-1edf018319a7ca7fcc88406f1fd73e180b7c0b63.tar.xz
yuzu-1edf018319a7ca7fcc88406f1fd73e180b7c0b63.zip
common/math_util: Provide a template deduction guide for Common::Rectangle
Allows for things such as: auto rect = Common::Rectangle{0, 0, 0, 0}; as opposed to being required to explicitly write out the underlying type, such as: auto rect = Common::Rectangle<int>{0, 0, 0, 0}; The only requirement for the deduction is that all constructor arguments be the same type.
-rw-r--r--src/common/math_util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common/math_util.h b/src/common/math_util.h
index cff3d48c5..d6c35ee89 100644
--- a/src/common/math_util.h
+++ b/src/common/math_util.h
@@ -41,4 +41,7 @@ struct Rectangle {
41 } 41 }
42}; 42};
43 43
44template <typename T>
45Rectangle(T, T, T, T)->Rectangle<T>;
46
44} // namespace Common 47} // namespace Common