diff options
Diffstat (limited to 'Bachelor/Prog2/SortedList2/Compare.h')
| -rw-r--r-- | Bachelor/Prog2/SortedList2/Compare.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Bachelor/Prog2/SortedList2/Compare.h b/Bachelor/Prog2/SortedList2/Compare.h new file mode 100644 index 0000000..336cf08 --- /dev/null +++ b/Bachelor/Prog2/SortedList2/Compare.h @@ -0,0 +1,20 @@ +// Function-object to compare two objects.
+// This template needs operator<() for objects of type T, but it is possible to
+// specialize it for any given type so that this template is not used.
+// Author: U.Breymann / H.P.Weber
+// Date: 05.05.05
+
+#ifndef COMPARE_H
+#define COMPARE_H
+
+template<class T>
+class Compare {
+public:
+ bool operator()( const T& a, const T& b ) const
+ {
+ return a < b;
+ }
+};
+
+#endif
+
|
