From e37159e2dbec9d760045d61d0811dc5630f75952 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 31 Jul 2003 22:47:17 +0000 Subject: [PATCH] Added min() and max() functions. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4173 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../disk_device_manager/KDiskDeviceUtils.h | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/headers/private/kernel/disk_device_manager/KDiskDeviceUtils.h b/headers/private/kernel/disk_device_manager/KDiskDeviceUtils.h index ab7d7345d3..80661835a6 100644 --- a/headers/private/kernel/disk_device_manager/KDiskDeviceUtils.h +++ b/headers/private/kernel/disk_device_manager/KDiskDeviceUtils.h @@ -13,6 +13,28 @@ namespace DiskDevice { // helper functions +// min +template +static inline +const T& +min(const T &a, const T &b) +{ + if (a < b) + return a; + return b; +} + +// max +template +static inline +const T& +max(const T &a, const T &b) +{ + if (a < b) + return b; + return a; +} + // set_string static inline status_t