Added min() and max() functions.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4173 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -13,6 +13,28 @@ namespace DiskDevice {
|
|||||||
|
|
||||||
// helper functions
|
// helper functions
|
||||||
|
|
||||||
|
// min
|
||||||
|
template<typename T>
|
||||||
|
static inline
|
||||||
|
const T&
|
||||||
|
min(const T &a, const T &b)
|
||||||
|
{
|
||||||
|
if (a < b)
|
||||||
|
return a;
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
// max
|
||||||
|
template<typename T>
|
||||||
|
static inline
|
||||||
|
const T&
|
||||||
|
max(const T &a, const T &b)
|
||||||
|
{
|
||||||
|
if (a < b)
|
||||||
|
return b;
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
|
||||||
// set_string
|
// set_string
|
||||||
static inline
|
static inline
|
||||||
status_t
|
status_t
|
||||||
|
|||||||
Reference in New Issue
Block a user