]> granicus.if.org Git - pdns/commitdiff
make replacing_insert from syncres.hh useable for the rest of pdns
authorBert Hubert <bert.hubert@netherlabs.nl>
Tue, 11 Jan 2011 21:41:15 +0000 (21:41 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Tue, 11 Jan 2011 21:41:15 +0000 (21:41 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1872 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/misc.hh
pdns/syncres.hh

index 9588d4bf0f5552c1360a0e492ae1cd3351fc4316..b39c59d0e45a3613b48ea1e88e08ff9c4dab1f24 100644 (file)
 #include <cstring>
 #include <cstdio>
 #include <boost/algorithm/string.hpp>
+#include <boost/multi_index_container.hpp>
+#include <boost/multi_index/ordered_index.hpp>
+#include <boost/tuple/tuple_comparison.hpp>
+#include <boost/multi_index/key_extractors.hpp>
+#include <boost/multi_index/sequenced_index.hpp>
+using namespace ::boost::multi_index;
 #if 0
 #include <iostream>
 using std::cout;
@@ -444,4 +450,15 @@ string labelReverse(const std::string& qname);
 std::string dotConcat(const std::string& a, const std::string &b);
 int makeIPv6sockaddr(const std::string& addr, struct sockaddr_in6* ret);
 bool stringfgets(FILE* fp, std::string& line);
+
+template<typename Index>
+std::pair<typename Index::iterator,bool>
+replacing_insert(Index& i,const typename Index::value_type& x)
+{
+  std::pair<typename Index::iterator,bool> res=i.insert(x);
+  if(!res.second)res.second=i.replace(res.first,x);
+  return res;
+}
+
+
 #endif
index 82adc2422b432e2a0492eb184a34ec5205390251..d34954061af25f8c52a2f226781224f14e1724ae 100644 (file)
@@ -524,14 +524,6 @@ void parseACLs();
 extern RecursorStats g_stats;
 extern unsigned int g_numThreads;
 
-template<typename Index>
-std::pair<typename Index::iterator,bool>
-replacing_insert(Index& i,const typename Index::value_type& x)
-{
-  std::pair<typename Index::iterator,bool> res=i.insert(x);
-  if(!res.second)res.second=i.replace(res.first,x);
-  return res;
-}
 
 
 std::string reloadAuthAndForwards();