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:
parent
ec4ef3525f
commit
e37159e2db
@ -13,6 +13,28 @@ namespace DiskDevice {
|
||||
|
||||
// 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
|
||||
static inline
|
||||
status_t
|
||||
|
Loading…
Reference in New Issue
Block a user