00001 /*---------------------------------------------------------------------\ 00002 | | 00003 | __ __ ____ _____ ____ | 00004 | \ \ / /_ _/ ___|_ _|___ \ | 00005 | \ V / _` \___ \ | | __) | | 00006 | | | (_| |___) || | / __/ | 00007 | |_|\__,_|____/ |_| |_____| | 00008 | | 00009 | core system | 00010 | (C) SuSE GmbH | 00011 \----------------------------------------------------------------------/ 00012 00013 File: ycpless.h 00014 00015 Author: Mathias Kettner <kettner@suse.de> 00016 Maintainer: Thomas Roelz <tom@suse.de> 00017 00018 /-*/ 00019 // -*- c++ -*- 00020 00021 #ifndef ycpless_h 00022 #define ycpless_h 00023 00024 #include "YCPValue.h" 00025 00026 using std::binary_function; 00027 00028 /* 00029 * global comparison function to be used with STL-Containers as generic 00030 * ordering operator. Compares two YCPValues and returns 00031 * true if the first value is less than the second one, 00032 * false otherwise. 00033 */ 00034 00035 struct ycpless : public binary_function<YCPValue, YCPValue, bool> 00036 { 00037 bool operator()(const YCPValue& x, const YCPValue& y) 00038 const { return x->compare(y) == YO_LESS; }; 00039 }; 00040 00041 #endif // ycpless_h