diff --git a/toml/literal.hpp b/toml/literal.hpp index 0824f83..1d338b7 100644 --- a/toml/literal.hpp +++ b/toml/literal.hpp @@ -12,11 +12,11 @@ inline namespace toml_literals { // implementation -inline ::toml::basic_value<::toml::discard_comments, std::unordered_map, std::vector> +inline ::toml::basic_value literal_internal_impl(::toml::detail::location loc) { using value_type = ::toml::basic_value< - ::toml::discard_comments, std::unordered_map, std::vector>; + TOML11_DEFAULT_COMMENT_STRATEGY, std::unordered_map, std::vector>; // if there are some comments or empty lines, skip them. using skip_line = ::toml::detail::repeat, @@ -81,7 +81,7 @@ literal_internal_impl(::toml::detail::location loc) } -inline ::toml::basic_value<::toml::discard_comments, std::unordered_map, std::vector> +inline ::toml::basic_value operator"" _toml(const char* str, std::size_t len) { ::toml::detail::location loc( @@ -95,7 +95,7 @@ operator"" _toml(const char* str, std::size_t len) #if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L // value of u8"" literal has been changed from char to char8_t and char8_t is // NOT compatible to char -inline ::toml::basic_value<::toml::discard_comments, std::unordered_map, std::vector> +inline ::toml::basic_value operator"" _toml(const char8_t* str, std::size_t len) { ::toml::detail::location loc( diff --git a/toml/parser.hpp b/toml/parser.hpp index c3df644..231df80 100644 --- a/toml/parser.hpp +++ b/toml/parser.hpp @@ -2076,7 +2076,7 @@ result parse_toml_file(location& loc) } // detail -template class Table = std::unordered_map, template class Array = std::vector> basic_value @@ -2127,7 +2127,7 @@ parse(std::istream& is, const std::string& fname = "unknown file") return data.unwrap(); } -template class Table = std::unordered_map, template class Array = std::vector> basic_value parse(const std::string& fname) @@ -2150,7 +2150,7 @@ basic_value parse(const std::string& fname) // // This function exactly matches to the invokation with c-string. // So this function is preferred than others and the ambiguity disappears. -template class Table = std::unordered_map, template class Array = std::vector> basic_value parse(const char* fname) @@ -2158,7 +2158,7 @@ basic_value parse(const char* fname) return parse(std::string(fname)); } -template class Table = std::unordered_map, template class Array = std::vector> basic_value parse(const std::filesystem::path& fpath) diff --git a/toml/value.hpp b/toml/value.hpp index e374c3b..f2e6c63 100644 --- a/toml/value.hpp +++ b/toml/value.hpp @@ -1739,7 +1739,8 @@ class basic_value }; // default toml::value and default array/table. -using value = basic_value; +// TOML11_DEFAULT_COMMENT_STRATEGY is defined in comments.hpp +using value = basic_value; using array = typename value::array_type; using table = typename value::table_type;