aboutsummaryrefslogtreecommitdiffstats
path: root/searchcommon
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-01-21 20:26:54 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-01-21 20:31:44 +0000
commitc0d7ecc0cc0644320518b1c4ff90ef2bb2c8b000 (patch)
treefe673393cbc79a9ab70a0a5d96caf3ad6c8d87b0 /searchcommon
parent4814eb34c725110f25ab4324699d6f17a291c116 (diff)
Add noexcept to move constructors and operators
Diffstat (limited to 'searchcommon')
-rw-r--r--searchcommon/src/vespa/searchcommon/attribute/config.cpp2
-rw-r--r--searchcommon/src/vespa/searchcommon/attribute/config.h2
-rw-r--r--searchcommon/src/vespa/searchcommon/common/schema.cpp29
-rw-r--r--searchcommon/src/vespa/searchcommon/common/schema.h12
4 files changed, 31 insertions, 14 deletions
diff --git a/searchcommon/src/vespa/searchcommon/attribute/config.cpp b/searchcommon/src/vespa/searchcommon/attribute/config.cpp
index ac3d2327157..53e57fd9c66 100644
--- a/searchcommon/src/vespa/searchcommon/attribute/config.cpp
+++ b/searchcommon/src/vespa/searchcommon/attribute/config.cpp
@@ -40,6 +40,8 @@ Config::Config(BasicType bt, CollectionType ct, bool fastSearch_, bool huge_)
Config::Config(const Config &) = default;
Config & Config::operator = (const Config &) = default;
+Config::Config(Config &&) noexcept = default;
+Config & Config::operator = (Config &&) noexcept = default;
Config::~Config() = default;
bool
diff --git a/searchcommon/src/vespa/searchcommon/attribute/config.h b/searchcommon/src/vespa/searchcommon/attribute/config.h
index fe464736a6b..2f767061f7a 100644
--- a/searchcommon/src/vespa/searchcommon/attribute/config.h
+++ b/searchcommon/src/vespa/searchcommon/attribute/config.h
@@ -19,6 +19,8 @@ public:
bool fastSearch_ = false, bool huge_ = false);
Config(const Config &);
Config & operator = (const Config &);
+ Config(Config &&) noexcept;
+ Config & operator = (Config &&) noexcept;
~Config();
BasicType basicType() const { return _basicType; }
diff --git a/searchcommon/src/vespa/searchcommon/common/schema.cpp b/searchcommon/src/vespa/searchcommon/common/schema.cpp
index 19d69b0c541..a21cc43572e 100644
--- a/searchcommon/src/vespa/searchcommon/common/schema.cpp
+++ b/searchcommon/src/vespa/searchcommon/common/schema.cpp
@@ -91,6 +91,11 @@ Schema::Field::Field(const std::vector<vespalib::string> & lines)
{
}
+Schema::Field::Field(const Field &) = default;
+Schema::Field & Schema::Field::operator = (const Field &) = default;
+Schema::Field::Field(Field &&) noexcept = default;
+Schema::Field & Schema::Field::operator = (Field &&) noexcept = default;
+
Schema::Field::~Field() = default;
void
@@ -139,6 +144,11 @@ Schema::IndexField::IndexField(const std::vector<vespalib::string> &lines)
{
}
+Schema::IndexField::IndexField(const IndexField &) = default;
+Schema::IndexField & Schema::IndexField::operator = (const IndexField &) = default;
+Schema::IndexField::IndexField(IndexField &&) noexcept = default;
+Schema::IndexField & Schema::IndexField::operator = (IndexField &&) noexcept = default;
+
void
Schema::IndexField::write(vespalib::asciistream & os, vespalib::stringref prefix) const
{
@@ -178,7 +188,10 @@ Schema::FieldSet::FieldSet(const std::vector<vespalib::string> & lines) :
}
}
-Schema::FieldSet::~FieldSet() { }
+Schema::FieldSet::FieldSet(const FieldSet &) = default;
+Schema::FieldSet & Schema::FieldSet::operator = (const FieldSet &) = default;
+
+Schema::FieldSet::~FieldSet() = default;
bool
Schema::FieldSet::operator==(const FieldSet &rhs) const
@@ -206,19 +219,7 @@ Schema::writeToStream(vespalib::asciistream &os, bool saveToDisk) const
}
}
-Schema::Schema()
- : _indexFields(),
- _attributeFields(),
- _summaryFields(),
- _fieldSets(),
- _importedAttributeFields(),
- _indexIds(),
- _attributeIds(),
- _summaryIds(),
- _fieldSetIds(),
- _importedAttributeIds()
-{
-}
+Schema::Schema() = default;
Schema::Schema(const Schema & rhs) = default;
Schema & Schema::operator=(const Schema & rhs) = default;
diff --git a/searchcommon/src/vespa/searchcommon/common/schema.h b/searchcommon/src/vespa/searchcommon/common/schema.h
index d71c14c90b1..e17d219d7e8 100644
--- a/searchcommon/src/vespa/searchcommon/common/schema.h
+++ b/searchcommon/src/vespa/searchcommon/common/schema.h
@@ -44,6 +44,10 @@ public:
* Create this field based on the given config lines.
**/
Field(const std::vector<vespalib::string> & lines);
+ Field(const Field &);
+ Field & operator = (const Field &);
+ Field(Field &&) noexcept;
+ Field & operator = (Field &&) noexcept;
virtual ~Field();
@@ -78,6 +82,10 @@ public:
public:
IndexField(vespalib::stringref name, DataType dt);
IndexField(vespalib::stringref name, DataType dt, CollectionType ct);
+ IndexField(const IndexField &);
+ IndexField & operator = (const IndexField &);
+ IndexField(IndexField &&) noexcept;
+ IndexField & operator = (IndexField &&) noexcept;
/**
* Create this index field based on the given config lines.
**/
@@ -114,6 +122,10 @@ public:
public:
FieldSet(vespalib::stringref n) : _name(n), _fields() {}
+ FieldSet(const FieldSet &);
+ FieldSet & operator =(const FieldSet &);
+ FieldSet(FieldSet &&) noexcept = default;
+ FieldSet & operator =(FieldSet &&) noexcept = default;
/**
* Create this field collection based on the given config lines.