fixed toml::literals namespace ambiguity (closes #69)
This commit is contained in:
parent
5f3e01f71c
commit
44c7da27d6
@ -204,6 +204,7 @@ UTF-8 decoding is performed using a state machine based on Bjoern Hoehrmann's '[
|
||||
- **[@shdnx](https://github.com/shdnx)** - Fixed a bug on GCC 8.2.0 and some meson config issues
|
||||
- **[@sobczyk](https://github.com/sobczyk)** - Reported some bugs
|
||||
- **[@sneves](https://github.com/sneves)** - Helped fix a number of parser bugs
|
||||
- **[@std-any-emplace](https://github.com/std-any-emplace)** - Reported some bugs
|
||||
- **[@traversaro](https://github.com/traversaro)** - Added vcpkg support and reported a bunch of bugs
|
||||
- **[@ximion](https://github.com/ximion)** - Added support for installation with meson
|
||||
- **[@whiterabbit963](https://github.com/whiterabbit963)** - Fixed a bug with value_or conversions
|
||||
|
@ -733,8 +733,12 @@ TOML_NAMESPACE_START
|
||||
return parse_file(std::basic_string_view<Char>{ file_path });
|
||||
}
|
||||
|
||||
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
|
||||
|
||||
inline namespace literals
|
||||
{
|
||||
TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, lit_ex, lit_noex)
|
||||
|
||||
/// \brief Parses TOML data from a string literal.
|
||||
///
|
||||
/// \detail \cpp
|
||||
@ -785,9 +789,8 @@ TOML_NAMESPACE_START
|
||||
|
||||
#endif // __cpp_lib_char8_t
|
||||
|
||||
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
|
||||
}
|
||||
|
||||
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
|
||||
}
|
||||
TOML_NAMESPACE_END
|
||||
|
||||
|
@ -3085,8 +3085,12 @@ TOML_NAMESPACE_START
|
||||
|
||||
#endif // __cpp_lib_char8_t
|
||||
|
||||
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
|
||||
|
||||
inline namespace literals
|
||||
{
|
||||
TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, lit_ex, lit_noex)
|
||||
|
||||
TOML_API
|
||||
TOML_EXTERNAL_LINKAGE
|
||||
parse_result operator"" _toml(const char* str, size_t len) TOML_MAY_THROW
|
||||
@ -3104,9 +3108,9 @@ TOML_NAMESPACE_START
|
||||
}
|
||||
|
||||
#endif // __cpp_lib_char8_t
|
||||
}
|
||||
|
||||
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
|
||||
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
|
||||
}
|
||||
}
|
||||
TOML_NAMESPACE_END
|
||||
|
||||
|
@ -136,5 +136,11 @@ TEST_CASE("user feedback")
|
||||
CHECK(ss.str() == "array = [ 'v1', 'v2', 'v3' ]"sv);
|
||||
});
|
||||
}
|
||||
|
||||
SECTION("github/issues/69") // https://github.com/marzer/tomlplusplus/issues/69
|
||||
{
|
||||
using namespace toml::literals; // should compile without namespace ambiguity
|
||||
auto table = "[table]\nkey=\"value\""_toml;
|
||||
}
|
||||
}
|
||||
|
||||
|
15
toml.hpp
15
toml.hpp
@ -7515,8 +7515,12 @@ TOML_NAMESPACE_START
|
||||
return parse_file(std::basic_string_view<Char>{ file_path });
|
||||
}
|
||||
|
||||
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
|
||||
|
||||
inline namespace literals
|
||||
{
|
||||
TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, lit_ex, lit_noex)
|
||||
|
||||
[[nodiscard]]
|
||||
TOML_API
|
||||
parse_result operator"" _toml(const char* str, size_t len) TOML_MAY_THROW;
|
||||
@ -7529,9 +7533,8 @@ TOML_NAMESPACE_START
|
||||
|
||||
#endif // __cpp_lib_char8_t
|
||||
|
||||
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
|
||||
}
|
||||
|
||||
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
|
||||
}
|
||||
TOML_NAMESPACE_END
|
||||
|
||||
@ -11806,8 +11809,12 @@ TOML_NAMESPACE_START
|
||||
|
||||
#endif // __cpp_lib_char8_t
|
||||
|
||||
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
|
||||
|
||||
inline namespace literals
|
||||
{
|
||||
TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, lit_ex, lit_noex)
|
||||
|
||||
TOML_API
|
||||
TOML_EXTERNAL_LINKAGE
|
||||
parse_result operator"" _toml(const char* str, size_t len) TOML_MAY_THROW
|
||||
@ -11825,9 +11832,9 @@ TOML_NAMESPACE_START
|
||||
}
|
||||
|
||||
#endif // __cpp_lib_char8_t
|
||||
}
|
||||
|
||||
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
|
||||
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
|
||||
}
|
||||
}
|
||||
TOML_NAMESPACE_END
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user