refactor: simplify inclusion dependencies

This commit is contained in:
ToruNiina
2019-10-31 21:58:28 +09:00
parent f98615d0df
commit 56812114c3

View File

@@ -2,7 +2,6 @@
// Distributed under the MIT License. // Distributed under the MIT License.
#ifndef TOML11_REGION_HPP #ifndef TOML11_REGION_HPP
#define TOML11_REGION_HPP #define TOML11_REGION_HPP
#include "exception.hpp"
#include <memory> #include <memory>
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
@@ -231,11 +230,10 @@ struct region final : public region_base
region& operator+=(const region& other) region& operator+=(const region& other)
{ {
if(this->begin() != other.begin() || this->end() != other.end() || // different regions cannot be concatenated
this->last_ != other.first_) assert(this->begin() == other.begin() && this->end() == other.end() &&
{ this->last_ == other.first_);
throw internal_error("invalid region concatenation");
}
this->last_ = other.last_; this->last_ = other.last_;
return *this; return *this;
} }