From: Bert Hubert Date: Tue, 11 Jan 2011 21:41:15 +0000 (+0000) Subject: make replacing_insert from syncres.hh useable for the rest of pdns X-Git-Tag: auth-3.0~375 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f0db590dae5efaf53271cbd60ef2f87f69db2cfc;p=pdns make replacing_insert from syncres.hh useable for the rest of pdns git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1872 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/misc.hh b/pdns/misc.hh index 9588d4bf0..b39c59d0e 100644 --- a/pdns/misc.hh +++ b/pdns/misc.hh @@ -21,6 +21,12 @@ #include #include #include +#include +#include +#include +#include +#include +using namespace ::boost::multi_index; #if 0 #include 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 +std::pair +replacing_insert(Index& i,const typename Index::value_type& x) +{ + std::pair res=i.insert(x); + if(!res.second)res.second=i.replace(res.first,x); + return res; +} + + #endif diff --git a/pdns/syncres.hh b/pdns/syncres.hh index 82adc2422..d34954061 100644 --- a/pdns/syncres.hh +++ b/pdns/syncres.hh @@ -524,14 +524,6 @@ void parseACLs(); extern RecursorStats g_stats; extern unsigned int g_numThreads; -template -std::pair -replacing_insert(Index& i,const typename Index::value_type& x) -{ - std::pair res=i.insert(x); - if(!res.second)res.second=i.replace(res.first,x); - return res; -} std::string reloadAuthAndForwards();