]> git.saurik.com Git - apt.git/commitdiff
srvrec: Do not expose C++11 tuple use in header
authorJulian Andres Klode <jak@debian.org>
Fri, 30 Oct 2015 13:44:52 +0000 (14:44 +0100)
committerJulian Andres Klode <jak@debian.org>
Fri, 30 Oct 2015 13:44:52 +0000 (14:44 +0100)
This makes non-C++11 reverse deps wishing to use it FTBFS.

apt-pkg/contrib/srvrec.cc
apt-pkg/contrib/srvrec.h

index 9af2826533ab5373c1183510d49f8a5a1d3511dc..be159bad932f40e08a046e96b2d83e1fac239ce1 100644 (file)
@@ -16,6 +16,7 @@
 #include <time.h>
 
 #include <algorithm>
+#include <tuple>
 
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/error.h>
 #include "srvrec.h"
 
 
+bool SrvRec::operator==(SrvRec const &other) const
+{
+   return (std::tie(target, priority, weight, port) ==
+           std::tie(other.target, other.priority, other.weight, other.port));
+}
+
 bool GetSrvRecords(std::string host, int port, std::vector<SrvRec> &Result)
 {
    std::string target;
index 920b6bb3249a162dfb605b7912f04c8755329e1d..01b810281b0c16ffe091da5be94a9f32d0bbecb3 100644 (file)
@@ -12,7 +12,6 @@
 #include <arpa/nameser.h>
 #include <vector>
 #include <string>
-#include <tuple>
 
 class SrvRec
 {
@@ -30,9 +29,7 @@ class SrvRec
    bool operator<(SrvRec const &other) const {
       return this->priority < other.priority;
    }
-   bool operator==(SrvRec const &other) const {
-      return std::tie(target, priority, weight, port) == std::tie(other.target, other.priority, other.weight, other.port);
-   }
+   bool operator==(SrvRec const &other) const;
 
    SrvRec(std::string const Target, u_int16_t const Priority,
         u_int16_t const Weight, u_int16_t const Port) :