"Fossies" - the Fresh Open Source Software Archive

Member "qdiff-0.9.1/trelops.h" (21 Oct 2008, 1568 Bytes) of package /linux/privat/old/qdiff-0.9.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /*GPL*START*
    2  * 
    3  * relops - implicit relational operator templates
    4  * 
    5  * Copyright (C) 1999 by Johannes Overmann <overmann@iname.com>
    6  * Copyright (C) 2008 by Tong Sun <suntong001@users.sourceforge.net>
    7  * 
    8  * This program is free software; you can redistribute it and/or modify
    9  * it under the terms of the GNU General Public License as published by
   10  * the Free Software Foundation; either version 2 of the License, or
   11  * (at your option) any later version.
   12  * 
   13  * This program is distributed in the hope that it will be useful,
   14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   16  * GNU General Public License for more details.
   17  * 
   18  * You should have received a copy of the GNU General Public License along
   19  * with this program; if not, write to the Free Software Foundation, Inc.,
   20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
   21  * *GPL*END*/  
   22 
   23 #ifndef _ngw_trelops_h_
   24 #define _ngw_trelops_h_
   25 
   26 // history:
   27 // 1999:
   28 // 13 Apr 23:45 started and finished !=, >, <=, >= works, its all very trivial
   29 
   30 
   31 
   32 // class T needs operator == to get operator !=
   33 // class T needs operator < to get operator >, >= and <=
   34 
   35 template<class T> inline bool operator != (const T& a, const T& b) {return !(a == b);}
   36 template<class T> inline bool operator >  (const T& a, const T& b) {return b < a;}
   37 template<class T> inline bool operator <= (const T& a, const T& b) {return !(b < a);}
   38 template<class T> inline bool operator >= (const T& a, const T& b) {return !(a < b);}
   39 
   40 #endif // _relops_h_
   41