]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
CharReach operators inline
authorAlex Coyte <a.coyte@intel.com>
Mon, 11 Apr 2016 03:47:10 +0000 (13:47 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Wed, 20 Apr 2016 03:34:56 +0000 (13:34 +1000)
src/util/charreach.cpp
src/util/charreach.h

index a231bbb052e076a948cd4aa3a572ff5b4de548de..9116b719db3b0f5d1102d1de048479d12a97c92a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Intel Corporation
+ * Copyright (c) 2015-2016, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -50,44 +50,6 @@ void CharReach::set(const std::string &s) {
     }
 }
 
-/// Bitwise OR.
-CharReach CharReach::operator|(const CharReach &a) const {
-    CharReach cr(*this);
-    cr.bits |= a.bits;
-    return cr;
-}
-
-/// Bitwise OR-equals.
-void CharReach::operator|=(const CharReach &a) {
-    bits |= a.bits;
-}
-
-/// Bitwise AND.
-CharReach CharReach::operator&(const CharReach &a) const {
-    CharReach cr(*this);
-    cr.bits &= a.bits;
-    return cr;
-}
-
-/// Bitwise AND-equals.
-void CharReach::operator&=(const CharReach &a) {
-    bits &= a.bits;
-}
-
-/// Bitwise complement.
-CharReach CharReach::operator~(void) const {
-    CharReach cr(*this);
-    cr.flip();
-    return cr;
-}
-
-/// Bitwise XOR.
-CharReach CharReach::operator^(const CharReach &a) const {
-    CharReach cr(*this);
-    cr.bits ^= a.bits;
-    return cr;
-}
-
 /// Do we only contain bits representing alpha characters?
 bool CharReach::isAlpha() const {
     if (none()) {
index 64bd969e57c6c10a2be6db5a8f2a72aa6da72e2b..53f2a5d27bb032b1708b3bd15e662c29457ae8f2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Intel Corporation
+ * Copyright (c) 2015-2016, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -135,22 +135,38 @@ public:
     size_t find_nth(size_t n) const { return bits.find_nth(n); }
 
     /// Bitwise OR.
-    CharReach operator|(const CharReach &a) const;
+    CharReach operator|(const CharReach &a) const {
+        CharReach cr(*this);
+        cr.bits |= a.bits;
+        return cr;
+    }
 
     /// Bitwise OR-equals.
-    void operator|=(const CharReach &a);
+    void operator|=(const CharReach &a) { bits |= a.bits; }
 
     /// Bitwise AND.
-    CharReach operator&(const CharReach &a) const;
+    CharReach operator&(const CharReach &a) const {
+        CharReach cr(*this);
+        cr.bits &= a.bits;
+        return cr;
+    }
 
     /// Bitwise AND-equals.
-    void operator&=(const CharReach &a);
+    void operator&=(const CharReach &a) { bits &= a.bits; }
 
     /// Bitwise XOR.
-    CharReach operator^(const CharReach &a) const;
+    CharReach operator^(const CharReach &a) const {
+        CharReach cr(*this);
+        cr.bits ^= a.bits;
+        return cr;
+    }
 
     /// Bitwise complement.
-    CharReach operator~(void) const;
+    CharReach operator~(void) const {
+        CharReach cr(*this);
+        cr.flip();
+        return cr;
+    }
 
     /// Do we only contain bits representing alpha characters?
     bool isAlpha() const;