From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- Bachelor/Prog2/SortedList2/Compare.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Bachelor/Prog2/SortedList2/Compare.h (limited to 'Bachelor/Prog2/SortedList2/Compare.h') 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 Compare { +public: + bool operator()( const T& a, const T& b ) const + { + return a < b; + } +}; + +#endif + -- cgit v1.2.3