Typo in manual
[clinton/bobotpp.git] / source / Utils.H
index ff1f6d7..46c0496 100644 (file)
 #include "config.h"
 #endif
 
-#include <ctime>
+#include <algorithm>
+#include <list>
 #include <string>
 
-#include "Bot.H"
+#include <ctime>
+
+class Bot;
 
 #ifdef USESCRIPTS
 #include <libguile.h>
@@ -80,6 +83,15 @@ namespace Utils {
     typedef T* second_argument_type;
     typedef bool result_type;
   };
+
+  template<typename T, typename C> 
+  void push_sorted (std::list<T> & storage, T item, C compare)
+  {
+    storage.insert (std::find_if (storage.begin (), storage.end (), 
+                                 std::bind1st (compare, item)),
+                   item);
+
+  }
 }
 
 #endif