diff --git a/src/math_eigen_impl.h b/src/math_eigen_impl.h index 6db06e0550..bedbfee333 100644 --- a/src/math_eigen_impl.h +++ b/src/math_eigen_impl.h @@ -215,8 +215,8 @@ namespace MathEigen { public: // C++ boilerplate: copy and move constructor, swap, and assignment operator Jacobi(const Jacobi& source); - Jacobi(Jacobi&& other); - void swap(Jacobi &other); + Jacobi(Jacobi&& other) noexcept; + void swap(Jacobi &other) noexcept; Jacobi& operator = (Jacobi source); }; // class Jacobi @@ -878,7 +878,7 @@ Jacobi(const Jacobi& source) template void Jacobi:: -swap(Jacobi &other) { +swap(Jacobi &other) noexcept { std::swap(n, other.n); std::swap(is_preallocated, other.is_preallocated); std::swap(max_idx_row, other.max_idx_row); @@ -888,7 +888,7 @@ swap(Jacobi &other) { // Move constructor (C++11) template Jacobi:: -Jacobi(Jacobi&& other) { +Jacobi(Jacobi&& other) noexcept { Init(); this->swap(other); } diff --git a/src/tokenizer.cpp b/src/tokenizer.cpp index bca80f7442..a754c92fdd 100644 --- a/src/tokenizer.cpp +++ b/src/tokenizer.cpp @@ -65,7 +65,7 @@ Tokenizer::Tokenizer(const Tokenizer &rhs) : reset(); } -Tokenizer::Tokenizer(Tokenizer &&rhs) : +Tokenizer::Tokenizer(Tokenizer &&rhs) noexcept : text(std::move(rhs.text)), separators(std::move(rhs.separators)), ntokens(rhs.ntokens) { reset(); @@ -78,14 +78,14 @@ Tokenizer &Tokenizer::operator=(const Tokenizer &other) return *this; } -Tokenizer &Tokenizer::operator=(Tokenizer &&other) +Tokenizer &Tokenizer::operator=(Tokenizer &&other) noexcept { Tokenizer tmp(std::move(other)); swap(tmp); return *this; } -void Tokenizer::swap(Tokenizer &other) +void Tokenizer::swap(Tokenizer &other) noexcept { std::swap(text, other.text); std::swap(separators, other.separators); @@ -221,7 +221,7 @@ ValueTokenizer::ValueTokenizer(const std::string &str, const std::string &separa { } -ValueTokenizer::ValueTokenizer(ValueTokenizer &&rhs) : tokens(std::move(rhs.tokens)) {} +ValueTokenizer::ValueTokenizer(ValueTokenizer &&rhs) noexcept : tokens(std::move(rhs.tokens)) {} ValueTokenizer &ValueTokenizer::operator=(const ValueTokenizer &other) { @@ -230,14 +230,14 @@ ValueTokenizer &ValueTokenizer::operator=(const ValueTokenizer &other) return *this; } -ValueTokenizer &ValueTokenizer::operator=(ValueTokenizer &&other) +ValueTokenizer &ValueTokenizer::operator=(ValueTokenizer &&other) noexcept { ValueTokenizer tmp(std::move(other)); swap(tmp); return *this; } -void ValueTokenizer::swap(ValueTokenizer &other) +void ValueTokenizer::swap(ValueTokenizer &other) noexcept { std::swap(tokens, other.tokens); } diff --git a/src/tokenizer.h b/src/tokenizer.h index 2334c52790..2283b4ee84 100644 --- a/src/tokenizer.h +++ b/src/tokenizer.h @@ -36,11 +36,11 @@ class Tokenizer { public: Tokenizer(std::string str, std::string separators = TOKENIZER_DEFAULT_SEPARATORS); - Tokenizer(Tokenizer &&); + Tokenizer(Tokenizer &&) noexcept; Tokenizer(const Tokenizer &); Tokenizer &operator=(const Tokenizer &); - Tokenizer &operator=(Tokenizer &&); - void swap(Tokenizer &); + Tokenizer &operator=(Tokenizer &&) noexcept; + void swap(Tokenizer &) noexcept; void reset(); void skip(int n = 1); @@ -111,10 +111,10 @@ class ValueTokenizer { ValueTokenizer(const std::string &str, const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); ValueTokenizer(const ValueTokenizer &) = default; - ValueTokenizer(ValueTokenizer &&); + ValueTokenizer(ValueTokenizer &&) noexcept; ValueTokenizer &operator=(const ValueTokenizer &); - ValueTokenizer &operator=(ValueTokenizer &&); - void swap(ValueTokenizer &); + ValueTokenizer &operator=(ValueTokenizer &&) noexcept; + void swap(ValueTokenizer &) noexcept; std::string next_string(); tagint next_tagint();