Fixing some missing throw statements.
Adding noexcept to move constructors / operators.
This commit is contained in:
parent
9a3901e159
commit
79d7a0130f
2 changed files with 11 additions and 11 deletions
|
@ -500,7 +500,7 @@ public:
|
||||||
if (NULLABLE)
|
if (NULLABLE)
|
||||||
this->values.push_back(nil_value());
|
this->values.push_back(nil_value());
|
||||||
else
|
else
|
||||||
std::runtime_error("Deserializing nil into a non-nullable object");
|
throw std::runtime_error("Deserializing nil into a non-nullable object");
|
||||||
} else {
|
} else {
|
||||||
std::istringstream iss(item_str);
|
std::istringstream iss(item_str);
|
||||||
double value;
|
double value;
|
||||||
|
@ -525,9 +525,9 @@ protected:
|
||||||
if (NULLABLE)
|
if (NULLABLE)
|
||||||
ss << "nil";
|
ss << "nil";
|
||||||
else
|
else
|
||||||
std::runtime_error("Serializing NaN");
|
throw std::runtime_error("Serializing NaN");
|
||||||
} else
|
} else
|
||||||
std::runtime_error("Serializing invalid number");
|
throw std::runtime_error("Serializing invalid number");
|
||||||
}
|
}
|
||||||
static bool vectors_equal(const std::vector<double> &v1, const std::vector<double> &v2) {
|
static bool vectors_equal(const std::vector<double> &v1, const std::vector<double> &v2) {
|
||||||
if (NULLABLE) {
|
if (NULLABLE) {
|
||||||
|
@ -646,7 +646,7 @@ public:
|
||||||
if (NULLABLE)
|
if (NULLABLE)
|
||||||
this->values.push_back(nil_value());
|
this->values.push_back(nil_value());
|
||||||
else
|
else
|
||||||
std::runtime_error("Deserializing nil into a non-nullable object");
|
throw std::runtime_error("Deserializing nil into a non-nullable object");
|
||||||
} else {
|
} else {
|
||||||
std::istringstream iss(item_str);
|
std::istringstream iss(item_str);
|
||||||
int value;
|
int value;
|
||||||
|
@ -663,7 +663,7 @@ private:
|
||||||
if (NULLABLE)
|
if (NULLABLE)
|
||||||
ss << "nil";
|
ss << "nil";
|
||||||
else
|
else
|
||||||
std::runtime_error("Serializing NaN");
|
throw std::runtime_error("Serializing NaN");
|
||||||
} else
|
} else
|
||||||
ss << v;
|
ss << v;
|
||||||
}
|
}
|
||||||
|
@ -1126,7 +1126,7 @@ public:
|
||||||
if (NULLABLE)
|
if (NULLABLE)
|
||||||
this->values.push_back(nil_value());
|
this->values.push_back(nil_value());
|
||||||
else
|
else
|
||||||
std::runtime_error("Deserializing nil into a non-nullable object");
|
throw std::runtime_error("Deserializing nil into a non-nullable object");
|
||||||
} else
|
} else
|
||||||
this->values.push_back(item_str.compare("1") == 0);
|
this->values.push_back(item_str.compare("1") == 0);
|
||||||
}
|
}
|
||||||
|
@ -1139,7 +1139,7 @@ protected:
|
||||||
if (NULLABLE)
|
if (NULLABLE)
|
||||||
ss << "nil";
|
ss << "nil";
|
||||||
else
|
else
|
||||||
std::runtime_error("Serializing NaN");
|
throw std::runtime_error("Serializing NaN");
|
||||||
} else
|
} else
|
||||||
ss << (v ? "1" : "0");
|
ss << (v ? "1" : "0");
|
||||||
}
|
}
|
||||||
|
@ -1638,7 +1638,7 @@ class DynamicConfig : public virtual ConfigBase
|
||||||
public:
|
public:
|
||||||
DynamicConfig() {}
|
DynamicConfig() {}
|
||||||
DynamicConfig(const DynamicConfig &rhs) { *this = rhs; }
|
DynamicConfig(const DynamicConfig &rhs) { *this = rhs; }
|
||||||
DynamicConfig(DynamicConfig &&rhs) : options(std::move(rhs.options)) { rhs.options.clear(); }
|
DynamicConfig(DynamicConfig &&rhs) noexcept : options(std::move(rhs.options)) { rhs.options.clear(); }
|
||||||
explicit DynamicConfig(const ConfigBase &rhs, const t_config_option_keys &keys);
|
explicit DynamicConfig(const ConfigBase &rhs, const t_config_option_keys &keys);
|
||||||
explicit DynamicConfig(const ConfigBase& rhs) : DynamicConfig(rhs, rhs.keys()) {}
|
explicit DynamicConfig(const ConfigBase& rhs) : DynamicConfig(rhs, rhs.keys()) {}
|
||||||
virtual ~DynamicConfig() override { clear(); }
|
virtual ~DynamicConfig() override { clear(); }
|
||||||
|
@ -1656,7 +1656,7 @@ public:
|
||||||
|
|
||||||
// Move a content of one DynamicConfig to another DynamicConfig.
|
// Move a content of one DynamicConfig to another DynamicConfig.
|
||||||
// If rhs.def() is not null, then it has to be equal to this->def().
|
// If rhs.def() is not null, then it has to be equal to this->def().
|
||||||
DynamicConfig& operator=(DynamicConfig &&rhs)
|
DynamicConfig& operator=(DynamicConfig &&rhs) noexcept
|
||||||
{
|
{
|
||||||
assert(this->def() == nullptr || this->def() == rhs.def());
|
assert(this->def() == nullptr || this->def() == rhs.def());
|
||||||
this->clear();
|
this->clear();
|
||||||
|
|
|
@ -19,7 +19,7 @@ class ExPolygon
|
||||||
public:
|
public:
|
||||||
ExPolygon() {}
|
ExPolygon() {}
|
||||||
ExPolygon(const ExPolygon &other) : contour(other.contour), holes(other.holes) {}
|
ExPolygon(const ExPolygon &other) : contour(other.contour), holes(other.holes) {}
|
||||||
ExPolygon(ExPolygon &&other) : contour(std::move(other.contour)), holes(std::move(other.holes)) {}
|
ExPolygon(ExPolygon &&other) noexcept : contour(std::move(other.contour)), holes(std::move(other.holes)) {}
|
||||||
explicit ExPolygon(const Polygon &contour) : contour(contour) {}
|
explicit ExPolygon(const Polygon &contour) : contour(contour) {}
|
||||||
explicit ExPolygon(Polygon &&contour) : contour(std::move(contour)) {}
|
explicit ExPolygon(Polygon &&contour) : contour(std::move(contour)) {}
|
||||||
explicit ExPolygon(const Points &contour) : contour(contour) {}
|
explicit ExPolygon(const Points &contour) : contour(contour) {}
|
||||||
|
@ -32,7 +32,7 @@ public:
|
||||||
ExPolygon(std::initializer_list<Point> contour, std::initializer_list<Point> hole) : contour(contour), holes({ hole }) {}
|
ExPolygon(std::initializer_list<Point> contour, std::initializer_list<Point> hole) : contour(contour), holes({ hole }) {}
|
||||||
|
|
||||||
ExPolygon& operator=(const ExPolygon &other) { contour = other.contour; holes = other.holes; return *this; }
|
ExPolygon& operator=(const ExPolygon &other) { contour = other.contour; holes = other.holes; return *this; }
|
||||||
ExPolygon& operator=(ExPolygon &&other) { contour = std::move(other.contour); holes = std::move(other.holes); return *this; }
|
ExPolygon& operator=(ExPolygon &&other) noexcept { contour = std::move(other.contour); holes = std::move(other.holes); return *this; }
|
||||||
|
|
||||||
Polygon contour;
|
Polygon contour;
|
||||||
Polygons holes;
|
Polygons holes;
|
||||||
|
|
Loading…
Add table
Reference in a new issue