From 898423166fab4f49908f20ab2c85c39af2b70de2 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Sun, 2 Jun 2019 00:02:31 +0900 Subject: [PATCH] feat: enable to convert preserve/discard comments --- toml/comments.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/toml/comments.hpp b/toml/comments.hpp index ef67de4..f43d02a 100644 --- a/toml/comments.hpp +++ b/toml/comments.hpp @@ -18,6 +18,7 @@ // error whenever you access to the element. namespace toml { +struct discard_comments; // forward decl // use it in the following way // @@ -54,6 +55,7 @@ struct preserve_comments explicit preserve_comments(std::vector&& c) : comments(std::move(c)) {} + explicit preserve_comments(const discard_comments&) {} explicit preserve_comments(size_type n): comments(n) {} 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&) noexcept {} explicit discard_comments(std::vector&&) noexcept {} + explicit discard_comments(const preserve_comments&) noexcept {} explicit discard_comments(size_type) noexcept {} discard_comments(size_type, const std::string&) noexcept {}