mirror of
https://github.com/PabloMK7/citra
synced 2024-11-15 13:18:24 +00:00
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.
This commit is contained in:
parent
186ffc235f
commit
a1b26db389
1 changed files with 3 additions and 0 deletions
|
@ -41,4 +41,7 @@ struct Rectangle {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
Rectangle(T, T, T, T)->Rectangle<T>;
|
||||||
|
|
||||||
} // namespace Common
|
} // namespace Common
|
||||||
|
|
Loading…
Reference in a new issue