From: bert hubert Date: Fri, 2 Oct 2015 13:09:21 +0000 (+0200) Subject: move make_unique around X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74ad42dc4c0cd5e01351325fb52ea8fa3208f594;p=thirdparty%2Fpdns.git move make_unique around --- diff --git a/pdns/dnsdist.hh b/pdns/dnsdist.hh index 0e0e12645d..a1c318bcbf 100644 --- a/pdns/dnsdist.hh +++ b/pdns/dnsdist.hh @@ -330,11 +330,6 @@ std::shared_ptr leastOutstanding(const NumberedServerVector& se std::shared_ptr wrandom(const NumberedServerVector& servers, const ComboAddress& remote, const DNSName& qname, uint16_t qtype, dnsheader* dh); std::shared_ptr roundrobin(const NumberedServerVector& servers, const ComboAddress& remote, const DNSName& qname, uint16_t qtype, dnsheader* dh); int getEDNSZ(const char* packet, unsigned int len); -template -std::unique_ptr make_unique(Args&&... args) -{ - return std::unique_ptr(new T(std::forward(args)...)); -} void dnsdistWebserverThread(int sock, const ComboAddress& local, const string& password); bool getMsgLen(int fd, uint16_t* len); bool putMsgLen(int fd, uint16_t len); diff --git a/pdns/misc.hh b/pdns/misc.hh index 43515a5a14..11f2526cdb 100644 --- a/pdns/misc.hh +++ b/pdns/misc.hh @@ -621,3 +621,9 @@ bool setNonBlocking( int sock ); int closesocket(int fd); bool setCloseOnExec(int sock); uint64_t udpErrorStats(const std::string& str); + +template +std::unique_ptr make_unique(Args&&... args) +{ + return std::unique_ptr(new T(std::forward(args)...)); +}