From ff95d116b79128b09b6beac79486d94156dd1f4a Mon Sep 17 00:00:00 2001 From: guruhegde Date: Mon, 16 Apr 2018 16:29:47 +0200 Subject: [PATCH] Add move support for query, queryparser & stem class --- xapian-core/include/xapian/query.h | 6 ++++++ xapian-core/include/xapian/queryparser.h | 6 ++++++ xapian-core/include/xapian/stem.h | 6 ++++++ xapian-core/languages/stem.cc | 5 +++++ xapian-core/queryparser/queryparser.cc | 5 +++++ 5 files changed, 28 insertions(+) diff --git a/xapian-core/include/xapian/query.h b/xapian-core/include/xapian/query.h index dce38d5c7..4343c8a01 100644 --- a/xapian-core/include/xapian/query.h +++ b/xapian-core/include/xapian/query.h @@ -181,6 +181,12 @@ class XAPIAN_VISIBILITY_DEFAULT Query { */ Query & operator=(const Query & o) { internal = o.internal; return *this; } + /// Move constructor. + Query(Query &&) = default; + + /// Move assignment operator. + Query & operator=(Query &&) = default; + /** Construct a Query object for a term. */ Query(const std::string & term, Xapian::termcount wqf = 1, diff --git a/xapian-core/include/xapian/queryparser.h b/xapian-core/include/xapian/queryparser.h index 27fb94a26..ffef21326 100644 --- a/xapian-core/include/xapian/queryparser.h +++ b/xapian-core/include/xapian/queryparser.h @@ -934,6 +934,12 @@ class XAPIAN_VISIBILITY_DEFAULT QueryParser { /// Assignment. QueryParser & operator=(const QueryParser & o); + /// Move constructor. + QueryParser(QueryParser && o); + + /// Move assignment operator. + QueryParser & operator=(QueryParser && o); + /// Default constructor. QueryParser(); diff --git a/xapian-core/include/xapian/stem.h b/xapian-core/include/xapian/stem.h index 951e265dd..3cb68a838 100644 --- a/xapian-core/include/xapian/stem.h +++ b/xapian-core/include/xapian/stem.h @@ -70,6 +70,12 @@ class XAPIAN_VISIBILITY_DEFAULT Stem { /// Assignment. Stem & operator=(const Stem & o); + /// Move constructor. + Stem(Stem && o); + + /// Move assignment operator. + Stem & operator=(Stem && o); + /** Construct a Xapian::Stem object which doesn't change terms. * * Equivalent to Stem("none"). diff --git a/xapian-core/languages/stem.cc b/xapian-core/languages/stem.cc index 7716b2845..6fee9142a 100644 --- a/xapian-core/languages/stem.cc +++ b/xapian-core/languages/stem.cc @@ -46,6 +46,11 @@ Stem::operator=(const Stem & o) return *this; } +Stem::Stem(Stem &&) = default; + +Stem & +Stem::operator=(Stem &&) = default; + Stem::Stem() { } Stem::Stem(const std::string &language) { diff --git a/xapian-core/queryparser/queryparser.cc b/xapian-core/queryparser/queryparser.cc index ae39450f2..59ba852bd 100644 --- a/xapian-core/queryparser/queryparser.cc +++ b/xapian-core/queryparser/queryparser.cc @@ -71,6 +71,11 @@ QueryParser::operator=(const QueryParser & o) return *this; } +QueryParser::QueryParser(QueryParser &&) = default; + +QueryParser & +QueryParser::operator=(QueryParser &&) = default; + QueryParser::QueryParser() : internal(new QueryParser::Internal) { } QueryParser::~QueryParser() { } -- 2.11.4.GIT