mirror of
https://git.suyu.dev/suyu/suyu
synced 2025-10-27 06:02:46 -05: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:
committed by
Rodrigo Locatti
parent
ed74a3cb8b
commit
1edf018319
@@ -41,4 +41,7 @@ struct Rectangle {
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
Rectangle(T, T, T, T)->Rectangle<T>;
|
||||
|
||||
} // namespace Common
|
||||
|
||||
Reference in New Issue
Block a user