Explorar o código

srvrec: Do not expose C++11 tuple use in header

This makes non-C++11 reverse deps wishing to use it FTBFS.
Julian Andres Klode %!s(int64=10) %!d(string=hai) anos
pai
achega
3129bd50d3
Modificáronse 2 ficheiros con 8 adicións e 4 borrados
  1. 7 0
      apt-pkg/contrib/srvrec.cc
  2. 1 4
      apt-pkg/contrib/srvrec.h

+ 7 - 0
apt-pkg/contrib/srvrec.cc

@@ -16,6 +16,7 @@
 #include <time.h>
 
 #include <algorithm>
+#include <tuple>
 
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/error.h>
@@ -25,6 +26,12 @@
 #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;

+ 1 - 4
apt-pkg/contrib/srvrec.h

@@ -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) :