Skip to content
Snippets Groups Projects
Commit c8dad563 authored by Mohammed Kabir's avatar Mohammed Kabir Committed by Kabir Mohammed
Browse files

mathlib : switch min/max to constexpr to match std::min/max

parent 9909a373
No related branches found
No related tags found
No related merge requests found
......@@ -56,19 +56,19 @@ namespace math
{
template<typename _Tp>
inline const _Tp &min(const _Tp &a, const _Tp &b)
inline constexpr const _Tp &min(const _Tp &a, const _Tp &b)
{
return (a < b) ? a : b;
}
template<typename _Tp>
inline const _Tp &max(const _Tp &a, const _Tp &b)
inline constexpr const _Tp &max(const _Tp &a, const _Tp &b)
{
return (a > b) ? a : b;
}
template<typename _Tp>
inline const _Tp &constrain(const _Tp &val, const _Tp &min_val, const _Tp &max_val)
inline constexpr const _Tp &constrain(const _Tp &val, const _Tp &min_val, const _Tp &max_val)
{
return (val < min_val) ? min_val : ((val > max_val) ? max_val : val);
}
......
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