Skip to content
Snippets Groups Projects
Commit 1edf0183 authored by Lioncash's avatar Lioncash Committed by Rodrigo Locatti
Browse files

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.
parent ed74a3cb
No related branches found
No related tags found
No related merge requests found
......@@ -41,4 +41,7 @@ struct Rectangle {
}
};
template <typename T>
Rectangle(T, T, T, T)->Rectangle<T>;
} // namespace Common
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment