mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-17 17:58:09 +08:00
feat: enable to convert preserve/discard comments
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
// error whenever you access to the element.
|
// error whenever you access to the element.
|
||||||
namespace toml
|
namespace toml
|
||||||
{
|
{
|
||||||
|
struct discard_comments; // forward decl
|
||||||
|
|
||||||
// use it in the following way
|
// use it in the following way
|
||||||
//
|
//
|
||||||
@@ -54,6 +55,7 @@ struct preserve_comments
|
|||||||
explicit preserve_comments(std::vector<std::string>&& c)
|
explicit preserve_comments(std::vector<std::string>&& c)
|
||||||
: comments(std::move(c))
|
: comments(std::move(c))
|
||||||
{}
|
{}
|
||||||
|
explicit preserve_comments(const discard_comments&) {}
|
||||||
|
|
||||||
explicit preserve_comments(size_type n): comments(n) {}
|
explicit preserve_comments(size_type n): comments(n) {}
|
||||||
preserve_comments(size_type n, const std::string& x): comments(n, x) {}
|
preserve_comments(size_type n, const std::string& x): comments(n, x) {}
|
||||||
@@ -276,6 +278,7 @@ struct discard_comments
|
|||||||
|
|
||||||
explicit discard_comments(const std::vector<std::string>&) noexcept {}
|
explicit discard_comments(const std::vector<std::string>&) noexcept {}
|
||||||
explicit discard_comments(std::vector<std::string>&&) noexcept {}
|
explicit discard_comments(std::vector<std::string>&&) noexcept {}
|
||||||
|
explicit discard_comments(const preserve_comments&) noexcept {}
|
||||||
|
|
||||||
explicit discard_comments(size_type) noexcept {}
|
explicit discard_comments(size_type) noexcept {}
|
||||||
discard_comments(size_type, const std::string&) noexcept {}
|
discard_comments(size_type, const std::string&) noexcept {}
|
||||||
|
Reference in New Issue
Block a user