From 1edf018319a7ca7fcc88406f1fd73e180b7c0b63 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 29 May 2019 02:47:01 -0400 Subject: [PATCH] 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{0, 0, 0, 0}; The only requirement for the deduction is that all constructor arguments be the same type. --- src/common/math_util.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common/math_util.h b/src/common/math_util.h index cff3d48c5c..d6c35ee899 100644 --- a/src/common/math_util.h +++ b/src/common/math_util.h @@ -41,4 +41,7 @@ struct Rectangle { } }; +template +Rectangle(T, T, T, T)->Rectangle; + } // namespace Common