From df619e601090e44df7a785e7dafd61c00191636f Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 4 Aug 2020 23:17:56 -0700 Subject: [PATCH] ircd::db::column: Indicate noexcept for various out-of-lines. --- include/ircd/db/column.h | 24 ++++++++++++------------ ircd/db.cc | 10 ++++++++-- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/include/ircd/db/column.h b/include/ircd/db/column.h index 2841647bf..23408f881 100644 --- a/include/ircd/db/column.h +++ b/include/ircd/db/column.h @@ -192,10 +192,10 @@ struct ircd::db::column::delta namespace ircd::db { - bool operator==(const column::const_iterator_base &, const column::const_iterator_base &); - bool operator!=(const column::const_iterator_base &, const column::const_iterator_base &); - bool operator<(const column::const_iterator_base &, const column::const_iterator_base &); - bool operator>(const column::const_iterator_base &, const column::const_iterator_base &); + bool operator==(const column::const_iterator_base &, const column::const_iterator_base &) noexcept; + bool operator!=(const column::const_iterator_base &, const column::const_iterator_base &) noexcept; + bool operator<(const column::const_iterator_base &, const column::const_iterator_base &) noexcept; + bool operator>(const column::const_iterator_base &, const column::const_iterator_base &) noexcept; } /// Iteration over all keys down a column. Default construction is an invalid @@ -219,7 +219,7 @@ struct ircd::db::column::const_iterator_base std::unique_ptr it; mutable value_type val; - const_iterator_base(database::column *const &, std::unique_ptr &&, db::gopts = {}); + const_iterator_base(database::column *const &, std::unique_ptr &&, db::gopts = {}) noexcept; public: explicit operator const database::column &() const; @@ -230,21 +230,21 @@ struct ircd::db::column::const_iterator_base explicit operator database::snapshot &(); explicit operator gopts &(); - operator bool() const; - bool operator!() const; + operator bool() const noexcept; + bool operator!() const noexcept; const value_type *operator->() const; const value_type &operator*() const; - const_iterator_base(); + const_iterator_base() noexcept; const_iterator_base(const_iterator_base &&) noexcept; const_iterator_base &operator=(const_iterator_base &&) noexcept; ~const_iterator_base() noexcept; - friend bool operator==(const const_iterator_base &, const const_iterator_base &); - friend bool operator!=(const const_iterator_base &, const const_iterator_base &); - friend bool operator<(const const_iterator_base &, const const_iterator_base &); - friend bool operator>(const const_iterator_base &, const const_iterator_base &); + friend bool operator==(const const_iterator_base &, const const_iterator_base &) noexcept; + friend bool operator!=(const const_iterator_base &, const const_iterator_base &) noexcept; + friend bool operator<(const const_iterator_base &, const const_iterator_base &) noexcept; + friend bool operator>(const const_iterator_base &, const const_iterator_base &) noexcept; template friend bool seek(column::const_iterator_base &, const pos &); }; diff --git a/ircd/db.cc b/ircd/db.cc index ad894b5de..7d85e6ff6 100644 --- a/ircd/db.cc +++ b/ircd/db.cc @@ -7076,6 +7076,7 @@ noexcept // linkage for incmplete rocksdb::Iterator ircd::db::column::const_iterator_base::const_iterator_base() +noexcept { } @@ -7088,6 +7089,7 @@ noexcept ircd::db::column::const_iterator_base::const_iterator_base(database::column *const &c, std::unique_ptr &&it, gopts opts) +noexcept :c{c} ,opts{std::move(opts)} ,it{std::move(it)} @@ -7113,13 +7115,13 @@ const bool ircd::db::column::const_iterator_base::operator!() -const +const noexcept { return !static_cast(*this); } ircd::db::column::const_iterator_base::operator bool() -const +const noexcept { if(!it) return false; @@ -7132,12 +7134,14 @@ const bool ircd::db::operator!=(const column::const_iterator_base &a, const column::const_iterator_base &b) +noexcept { return !(a == b); } bool ircd::db::operator==(const column::const_iterator_base &a, const column::const_iterator_base &b) +noexcept { if(a && b) { @@ -7154,6 +7158,7 @@ ircd::db::operator==(const column::const_iterator_base &a, const column::const_i bool ircd::db::operator>(const column::const_iterator_base &a, const column::const_iterator_base &b) +noexcept { if(a && b) { @@ -7174,6 +7179,7 @@ ircd::db::operator>(const column::const_iterator_base &a, const column::const_it bool ircd::db::operator<(const column::const_iterator_base &a, const column::const_iterator_base &b) +noexcept { if(a && b) {