compare.h

Go to the documentation of this file.
00001 /*  _________________________________________________________________________
00002  *
00003  *  UTILIB: A utility library for developing portable C++ codes.
00004  *  Copyright (c) 2001, Sandia National Laboratories.
00005  *  This software is distributed under the GNU Lesser General Public License.
00006  *  For more information, see the README file in the top UTILIB directory.
00007  *  _________________________________________________________________________
00008  */
00009 
00016 #ifndef __compare_h
00017 #define __compare_h
00018 
00023 template <class T>
00024 int compare(const T& x, const T& y)
00025 {
00026 if (x<y) return -1;
00027 if (x>y) return 1;
00028 return 0;
00029 }
00030 
00031 #endif