Skip to content

Commit

Permalink
Merge pull request #23326 from vespa-engine/toregge/add-noexcept-spec…
Browse files Browse the repository at this point in the history
…ifier

Add noexcept specifier.
  • Loading branch information
baldersheim authored Jul 3, 2022
2 parents a8d3000 + b8eb1f7 commit 6760568
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion metrics/src/vespa/metrics/metric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Tag::Tag(vespalib::stringref k, vespalib::stringref v)
_value(NameRepo::tagValueId(v))
{ }

Tag::Tag(const Tag &) = default;
Tag::Tag(const Tag &) noexcept = default;
Tag & Tag::operator = (const Tag &) = default;
Tag::~Tag() {}

Expand Down
2 changes: 1 addition & 1 deletion metrics/src/vespa/metrics/metric.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ struct Tag

Tag(vespalib::stringref k);
Tag(vespalib::stringref k, vespalib::stringref v);
Tag(const Tag &);
Tag(const Tag &) noexcept;
Tag & operator = (const Tag &);
Tag(Tag &&) = default;
Tag & operator = (Tag &&) = default;
Expand Down
2 changes: 1 addition & 1 deletion searchlib/src/vespa/searchlib/diskindex/diskindex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void swap(DiskIndex::LookupResult & a, DiskIndex::LookupResult & b)
a.swap(b);
}

DiskIndex::LookupResult::LookupResult()
DiskIndex::LookupResult::LookupResult() noexcept
: indexId(0u),
wordNum(0),
counts(),
Expand Down
2 changes: 1 addition & 1 deletion searchlib/src/vespa/searchlib/diskindex/diskindex.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class DiskIndex : public queryeval::Searchable {
index::PostingListCounts counts;
uint64_t bitOffset;
typedef std::unique_ptr<LookupResult> UP;
LookupResult();
LookupResult() noexcept;
bool valid() const { return counts._numDocs > 0; }
void swap(LookupResult & rhs) {
std::swap(indexId , rhs.indexId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ namespace search::features {
//---------------------------------------------------------------------------------------------------------------------
// TedCell
//---------------------------------------------------------------------------------------------------------------------
TedCell::TedCell() :
TedCell::TedCell() noexcept :
cost(util::FEATURE_MAX),
numDel(0),
numIns(0),
numSub(0)
{}

TedCell::TedCell(feature_t argCost, uint32_t argNumDel, uint32_t argNumIns, uint32_t argNumSub) :
TedCell::TedCell(feature_t argCost, uint32_t argNumDel, uint32_t argNumIns, uint32_t argNumSub) noexcept :
cost(argCost),
numDel(argNumDel),
numIns(argNumIns),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ namespace search::features {
*/
class TedCell {
public:
TedCell();
TedCell(feature_t cost, uint32_t numDel, uint32_t numIns, uint32_t numSub);
TedCell() noexcept;
TedCell(feature_t cost, uint32_t numDel, uint32_t numIns, uint32_t numSub) noexcept;

feature_t cost; // The cost at this point.
uint32_t numDel; // The number of deletions to get here.
Expand Down
4 changes: 2 additions & 2 deletions vespalib/src/tests/datastore/buffer_type/buffer_type_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct Setup {
_allocGrowFactor(0.5),
_resizing(false)
{}
Setup(const Setup& rhs);
Setup(const Setup& rhs) noexcept;
Setup &minArrays(uint32_t value) { _minArrays = value; return *this; }
Setup &used(size_t value) { _usedElems = value; return *this; }
Setup &needed(size_t value) { _neededElems = value; return *this; }
Expand All @@ -36,7 +36,7 @@ struct Setup {
Setup &resizing(bool value) { _resizing = value; return *this; }
};

Setup::Setup(const Setup& rhs)
Setup::Setup(const Setup& rhs) noexcept
: _minArrays(rhs._minArrays),
_usedElems(rhs._usedElems.load(std::memory_order_relaxed)),
_neededElems(rhs._neededElems),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ struct IndirectContext {
static constexpr size_t values_size = 65536;
uint64_t _values[values_size];

IndirectContext();
IndirectContext() noexcept;
uint64_t* calc_value_ptr(uint64_t idx) { return &_values[(idx & (values_size - 1))]; }
};

IndirectContext::IndirectContext()
IndirectContext::IndirectContext() noexcept
: _value_ptr(nullptr),
_pad(),
_values()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace vespalib {

//-----------------------------------------------------------------------------

AdaptiveSequencedExecutor::Strand::Strand()
AdaptiveSequencedExecutor::Strand::Strand() noexcept
: state(State::IDLE),
queue()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class AdaptiveSequencedExecutor : public ISequencedTaskExecutor
enum class State { IDLE, WAITING, ACTIVE };
State state;
ArrayQueue<TaggedTask> queue;
Strand();
Strand() noexcept;
~Strand();
};

Expand Down

0 comments on commit 6760568

Please sign in to comment.