mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-18 02:08:09 +08:00
refactor: add a constructor to location
By adding the constructor, vec() would not be not needed. But inserting Container = std::string makes the constructor ambiguous, so it breaks the current code.
This commit is contained in:
@@ -85,6 +85,12 @@ struct location final : public region_base
|
|||||||
: source_(std::make_shared<Container>(std::move(cont))), line_number_(1),
|
: source_(std::make_shared<Container>(std::move(cont))), line_number_(1),
|
||||||
source_name_(std::move(name)), iter_(source_->cbegin())
|
source_name_(std::move(name)), iter_(source_->cbegin())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
location(std::string name, const std::string& cont)
|
||||||
|
: source_(std::make_shared<Container>(cont.begin(), cont.end())),
|
||||||
|
line_number_(1), source_name_(std::move(name)), iter_(source_->cbegin())
|
||||||
|
{}
|
||||||
|
|
||||||
location(const location&) = default;
|
location(const location&) = default;
|
||||||
location(location&&) = default;
|
location(location&&) = default;
|
||||||
location& operator=(const location&) = default;
|
location& operator=(const location&) = default;
|
||||||
|
Reference in New Issue
Block a user