diff options
| author | 2019-05-29 02:47:01 -0400 | |
|---|---|---|
| committer | 2019-05-31 04:44:02 -0300 | |
| commit | 1edf018319a7ca7fcc88406f1fd73e180b7c0b63 (patch) | |
| tree | f9e110a03f3ce287cd7c9a5a6a7eb07948fd2f72 /src/common/math_util.h | |
| parent | Merge pull request #1931 from DarkLordZach/mii-database-1 (diff) | |
| download | yuzu-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.
Diffstat (limited to '')
| -rw-r--r-- | src/common/math_util.h | 3 |
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 | ||
| 44 | template <typename T> | ||
| 45 | Rectangle(T, T, T, T)->Rectangle<T>; | ||
| 46 | |||
| 44 | } // namespace Common | 47 | } // namespace Common |