]> granicus.if.org Git - pdns/commitdiff
add inline operators for qtype comparison, thanks Mark Zealey. Closes #646
authorPeter van Dijk <peter.van.dijk@netherlabs.nl>
Thu, 16 May 2013 11:49:46 +0000 (13:49 +0200)
committerPeter van Dijk <peter.van.dijk@netherlabs.nl>
Thu, 16 May 2013 11:49:46 +0000 (13:49 +0200)
pdns/qtype.cc
pdns/qtype.hh

index 35d422b65d8395be9cc4c8b6c6bef235bcf10f7f..3b00d6ab338e3d381c76a955c048182c6d81813b 100644 (file)
@@ -80,11 +80,6 @@ QType &QType::operator=(const char *p)
   return *this;
 }
 
-bool QType::operator==(const QType &comp) const
-{
-  return(comp.code==code);
-}
-
 QType &QType::operator=(const string &s)
 {
   code=chartocode(s.c_str());
index 4d063ed0636d81fb0dc5392a2540957bbe259ac4..8ce807f77961e48b5ed885142e4d43ab0595fca5 100644 (file)
@@ -69,8 +69,6 @@ public:
     ar & code;
   }
 
-  bool operator==(const QType &) const; //!< equality operator
-
   const string getName() const; //!< Get a string representation of this type
   uint16_t getCode() const; //!< Get the integer representation of this type
 
@@ -83,6 +81,22 @@ public:
   typedef pair<string,uint16_t> namenum; 
   static vector<namenum> names;
 
+  inline bool operator==(const QType &comp) const {
+      return(comp.code==code);
+  }
+
+  inline bool operator!=(const QType &comp) const {
+      return(comp.code!=code);
+  }
+
+  inline bool operator==(QType::typeenum comp) const {
+      return(comp==code);
+  }
+
+  inline bool operator!=(QType::typeenum comp) const {
+      return(comp!=code);
+  }
+
 private:
   static class init {
     public: