Make RE2::Options copyable
(There seems to be little reason to block copying a 24 byte struct.)
Change-Id: I6002bfeb7e2598aa827cd42e951e5d59f8c198b4
Reviewed-on: https://code-review.googlesource.com/4891
Reviewed-by: Paul Wankadia <junyer@google.com>
diff --git a/re2/re2.h b/re2/re2.h
index ea96f5a..b8d8681 100644
--- a/re2/re2.h
+++ b/re2/re2.h
@@ -650,19 +650,7 @@
void set_one_line(bool b) { one_line_ = b; }
void Copy(const Options& src) {
- encoding_ = src.encoding_;
- posix_syntax_ = src.posix_syntax_;
- longest_match_ = src.longest_match_;
- log_errors_ = src.log_errors_;
- max_mem_ = src.max_mem_;
- literal_ = src.literal_;
- never_nl_ = src.never_nl_;
- dot_nl_ = src.dot_nl_;
- never_capture_ = src.never_capture_;
- case_sensitive_ = src.case_sensitive_;
- perl_classes_ = src.perl_classes_;
- word_boundary_ = src.word_boundary_;
- one_line_ = src.one_line_;
+ *this = src;
}
int ParseFlags() const;
@@ -681,10 +669,6 @@
bool perl_classes_;
bool word_boundary_;
bool one_line_;
-
- //DISALLOW_COPY_AND_ASSIGN(Options);
- Options(const Options&);
- void operator=(const Options&);
};
// Returns the options set in the constructor.