2021-10-23 09:22:41 +00:00
|
|
|
//# This file is a part of toml++ and is subject to the the terms of the MIT license.
|
|
|
|
//# Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
|
|
|
//# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
#pragma once
|
2021-10-24 22:04:23 +00:00
|
|
|
|
2021-10-23 09:22:41 +00:00
|
|
|
//# {{
|
|
|
|
#include "preprocessor.h"
|
|
|
|
#if !TOML_IMPLEMENTATION
|
2021-10-24 22:04:23 +00:00
|
|
|
#error This is an implementation-only header.
|
2021-10-23 09:22:41 +00:00
|
|
|
#endif
|
|
|
|
//# }}
|
|
|
|
|
|
|
|
#include "node.h"
|
2021-10-24 22:04:23 +00:00
|
|
|
#include "node_view.h"
|
2021-10-24 10:21:32 +00:00
|
|
|
#include "header_start.h"
|
2021-10-23 09:22:41 +00:00
|
|
|
|
|
|
|
TOML_NAMESPACE_START
|
|
|
|
{
|
|
|
|
TOML_EXTERNAL_LINKAGE
|
|
|
|
node::node(node && other) noexcept //
|
|
|
|
: source_{ std::exchange(other.source_, {}) }
|
|
|
|
{}
|
|
|
|
|
|
|
|
TOML_EXTERNAL_LINKAGE
|
|
|
|
node::node(const node& /*other*/) noexcept
|
|
|
|
{
|
|
|
|
// does not copy source information - this is not an error
|
|
|
|
//
|
|
|
|
// see https://github.com/marzer/tomlplusplus/issues/49#issuecomment-665089577
|
|
|
|
}
|
|
|
|
|
|
|
|
TOML_EXTERNAL_LINKAGE
|
|
|
|
node& node::operator=(const node& /*rhs*/) noexcept
|
|
|
|
{
|
|
|
|
// does not copy source information - this is not an error
|
|
|
|
//
|
|
|
|
// see https://github.com/marzer/tomlplusplus/issues/49#issuecomment-665089577
|
|
|
|
|
|
|
|
source_ = {};
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
TOML_EXTERNAL_LINKAGE
|
|
|
|
node& node::operator=(node&& rhs) noexcept
|
|
|
|
{
|
|
|
|
if (&rhs != this)
|
|
|
|
source_ = std::exchange(rhs.source_, {});
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
TOML_EXTERNAL_LINKAGE
|
2021-10-24 22:04:23 +00:00
|
|
|
node::~node() noexcept = default;
|
2021-10-23 09:22:41 +00:00
|
|
|
}
|
|
|
|
TOML_NAMESPACE_END;
|
2021-10-24 10:21:32 +00:00
|
|
|
|
|
|
|
#include "header_end.h"
|