summaryrefslogtreecommitdiff
path: root/grpc/third_party/re2/re2/set.h
diff options
context:
space:
mode:
Diffstat (limited to 'grpc/third_party/re2/re2/set.h')
-rw-r--r--grpc/third_party/re2/re2/set.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/grpc/third_party/re2/re2/set.h b/grpc/third_party/re2/re2/set.h
index 59733fd9..8d64f30c 100644
--- a/grpc/third_party/re2/re2/set.h
+++ b/grpc/third_party/re2/re2/set.h
@@ -5,6 +5,7 @@
#ifndef RE2_SET_H_
#define RE2_SET_H_
+#include <memory>
#include <string>
#include <utility>
#include <vector>
@@ -36,6 +37,13 @@ class RE2::Set {
Set(const RE2::Options& options, RE2::Anchor anchor);
~Set();
+ // Not copyable.
+ Set(const Set&) = delete;
+ Set& operator=(const Set&) = delete;
+ // Movable.
+ Set(Set&& other);
+ Set& operator=(Set&& other);
+
// Adds pattern to the set using the options passed to the constructor.
// Returns the index that will identify the regexp in the output of Match(),
// or -1 if the regexp cannot be parsed.
@@ -67,12 +75,9 @@ class RE2::Set {
RE2::Options options_;
RE2::Anchor anchor_;
std::vector<Elem> elem_;
- re2::Prog* prog_;
bool compiled_;
int size_;
-
- Set(const Set&) = delete;
- Set& operator=(const Set&) = delete;
+ std::unique_ptr<re2::Prog> prog_;
};
} // namespace re2