diff options
author | Tor Egge <Tor.Egge@broadpark.no> | 2020-12-05 16:23:51 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@broadpark.no> | 2020-12-05 16:23:51 +0100 |
commit | 7ce18031173d52b93073fa9fd9d2c57a9fdd1390 (patch) | |
tree | a66806e7817d9b963e376b43765f7b8e36294f4d /searchcommon | |
parent | 4b5cb9770f115b73f03fe59d6d1a4f30097cf739 (diff) |
Add noexcept specifiers to non-throwing constructors and operators.
Diffstat (limited to 'searchcommon')
-rw-r--r-- | searchcommon/src/vespa/searchcommon/common/schema.cpp | 18 | ||||
-rw-r--r-- | searchcommon/src/vespa/searchcommon/common/schema.h | 18 |
2 files changed, 18 insertions, 18 deletions
diff --git a/searchcommon/src/vespa/searchcommon/common/schema.cpp b/searchcommon/src/vespa/searchcommon/common/schema.cpp index c59edbef22f..735365f6aaf 100644 --- a/searchcommon/src/vespa/searchcommon/common/schema.cpp +++ b/searchcommon/src/vespa/searchcommon/common/schema.cpp @@ -69,17 +69,17 @@ namespace index { const uint32_t Schema::UNKNOWN_FIELD_ID(std::numeric_limits<uint32_t>::max()); -Schema::Field::Field(vespalib::stringref n, DataType dt) +Schema::Field::Field(vespalib::stringref n, DataType dt) noexcept : Field(n, dt, schema::CollectionType::SINGLE, "") { } -Schema::Field::Field(vespalib::stringref n, DataType dt, CollectionType ct) +Schema::Field::Field(vespalib::stringref n, DataType dt, CollectionType ct) noexcept : Field(n, dt, ct, "") { } -Schema::Field::Field(vespalib::stringref n, DataType dt, CollectionType ct, vespalib::stringref tensor_spec) +Schema::Field::Field(vespalib::stringref n, DataType dt, CollectionType ct, vespalib::stringref tensor_spec) noexcept : _name(n), _dataType(dt), _collectionType(ct), @@ -95,8 +95,8 @@ 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(const Field &) noexcept = default; +Schema::Field & Schema::Field::operator = (const Field &) noexcept = default; Schema::Field::Field(Field &&) noexcept = default; Schema::Field & Schema::Field::operator = (Field &&) noexcept = default; @@ -125,7 +125,7 @@ Schema::Field::operator!=(const Field &rhs) const return !((*this) == rhs); } -Schema::IndexField::IndexField(vespalib::stringref name, DataType dt) +Schema::IndexField::IndexField(vespalib::stringref name, DataType dt) noexcept : Field(name, dt), _avgElemLen(512), _interleaved_features(false) @@ -133,7 +133,7 @@ Schema::IndexField::IndexField(vespalib::stringref name, DataType dt) } Schema::IndexField::IndexField(vespalib::stringref name, DataType dt, - CollectionType ct) + CollectionType ct) noexcept : Field(name, dt, ct), _avgElemLen(512), _interleaved_features(false) @@ -147,8 +147,8 @@ 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(const IndexField &) noexcept = default; +Schema::IndexField & Schema::IndexField::operator = (const IndexField &) noexcept = default; Schema::IndexField::IndexField(IndexField &&) noexcept = default; Schema::IndexField & Schema::IndexField::operator = (IndexField &&) noexcept = default; diff --git a/searchcommon/src/vespa/searchcommon/common/schema.h b/searchcommon/src/vespa/searchcommon/common/schema.h index 9003578adaf..740cf4ffad6 100644 --- a/searchcommon/src/vespa/searchcommon/common/schema.h +++ b/searchcommon/src/vespa/searchcommon/common/schema.h @@ -38,16 +38,16 @@ public: vespalib::string _tensor_spec; public: - Field(vespalib::stringref n, DataType dt); - Field(vespalib::stringref n, DataType dt, CollectionType ct); - Field(vespalib::stringref n, DataType dt, CollectionType ct, vespalib::stringref tensor_spec); + Field(vespalib::stringref n, DataType dt) noexcept; + Field(vespalib::stringref n, DataType dt, CollectionType ct) noexcept; + Field(vespalib::stringref n, DataType dt, CollectionType ct, vespalib::stringref tensor_spec) noexcept; /** * Create this field based on the given config lines. **/ Field(const std::vector<vespalib::string> & lines); - Field(const Field &); - Field & operator = (const Field &); + Field(const Field &) noexcept; + Field & operator = (const Field &) noexcept; Field(Field &&) noexcept; Field & operator = (Field &&) noexcept; @@ -83,10 +83,10 @@ public: bool _interleaved_features; public: - IndexField(vespalib::stringref name, DataType dt); - IndexField(vespalib::stringref name, DataType dt, CollectionType ct); - IndexField(const IndexField &); - IndexField & operator = (const IndexField &); + IndexField(vespalib::stringref name, DataType dt) noexcept; + IndexField(vespalib::stringref name, DataType dt, CollectionType ct) noexcept; + IndexField(const IndexField &) noexcept; + IndexField & operator = (const IndexField &) noexcept; IndexField(IndexField &&) noexcept; IndexField & operator = (IndexField &&) noexcept; /** |