[opengtl-commits] [361] add min/max utils function

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 361
Author:   cyrille
Date:     2008-09-03 23:05:09 +0200 (Wed, 03 Sep 2008)

Log Message:
-----------
add min/max utils function

Modified Paths:
--------------
    trunk/OpenGTL/OpenGTL/GTLCore/Utils_p.h


Modified: trunk/OpenGTL/OpenGTL/GTLCore/Utils_p.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Utils_p.h	2008-09-03 21:04:52 UTC (rev 360)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Utils_p.h	2008-09-03 21:05:09 UTC (rev 361)
@@ -48,6 +48,18 @@
       delete it->second;
     }
   }
+  
+  template<typename _T_>
+  inline _T_ min( _T_ t1, _T_ t2 )
+  {
+    return t1 < t2 ? t1 : t2;
+  }
+  
+  template<typename _T_>
+  inline _T_ max( _T_ t1, _T_ t2 )
+  {
+    return t1 > t2 ? t1 : t2;
+  }
 
 }
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/