Skip to content

Commit

Permalink
Foundation: Make min and max arguments and return value references
Browse files Browse the repository at this point in the history
  • Loading branch information
Pagghiu committed Apr 3, 2024
1 parent f6a4ecf commit 720a90f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Libraries/Foundation/Compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@ template <typename T> constexpr inline void swap(T& t1, T& t2)
//! @{

/// Finds the minimum of two values.
template <typename T> constexpr T min(T t1, T t2) { return t1 < t2 ? t1 : t2; }
template <typename T> constexpr const T& min(const T& t1, const T& t2) { return t1 < t2 ? t1 : t2; }
/// Finds the maximum of two values.
template <typename T> constexpr T max(T t1, T t2) { return t1 > t2 ? t1 : t2; }
template <typename T> constexpr const T& max(const T& t1, const T& t2) { return t1 > t2 ? t1 : t2; }

//! @}

Expand Down

0 comments on commit 720a90f

Please sign in to comment.