mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-17 00:38:08 +08:00
feat: workaround __cplusplus problem on MSVC
This commit is contained in:
@@ -272,7 +272,7 @@ BOOST_AUTO_TEST_CASE(test_construct_value_with_comments)
|
||||
BOOST_TEST(v.is_string());
|
||||
BOOST_TEST(v.as_string() == "str");
|
||||
}
|
||||
#if __cplusplus >= 201703L
|
||||
#if TOML11_CPLUSPLUS_STANDARD_VERSION >= 201703L
|
||||
{
|
||||
using namespace std::literals::string_view_literals;
|
||||
const value_type v("str"sv, {"comment1", "comment2"});
|
||||
|
@@ -13,7 +13,7 @@
|
||||
#include <list>
|
||||
#include <deque>
|
||||
#include <array>
|
||||
#if __cplusplus >= 201703L
|
||||
#if TOML11_CPLUSPLUS_STANDARD_VERSION >= 201703L
|
||||
#include <string_view>
|
||||
#endif
|
||||
#include <tuple>
|
||||
@@ -477,7 +477,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(test_find_string_type, value_type, test_value_type
|
||||
BOOST_TEST("foo" == moved);
|
||||
}
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#if TOML11_CPLUSPLUS_STANDARD_VERSION >= 201703L
|
||||
{
|
||||
value_type v{{"key", toml::string("foo", toml::string_t::basic)}};
|
||||
BOOST_TEST("foo" == toml::find<std::string_view>(v, "key"));
|
||||
|
@@ -12,7 +12,7 @@
|
||||
#include <deque>
|
||||
#include <array>
|
||||
#include <tuple>
|
||||
#if __cplusplus >= 201703L
|
||||
#if TOML11_CPLUSPLUS_STANDARD_VERSION >= 201703L
|
||||
#include <string_view>
|
||||
#endif
|
||||
|
||||
|
@@ -12,7 +12,7 @@
|
||||
#include <deque>
|
||||
#include <array>
|
||||
#include <tuple>
|
||||
#if __cplusplus >= 201703L
|
||||
#if TOML11_CPLUSPLUS_STANDARD_VERSION >= 201703L
|
||||
#include <string_view>
|
||||
#endif
|
||||
|
||||
|
@@ -12,7 +12,7 @@
|
||||
#include <deque>
|
||||
#include <array>
|
||||
#include <tuple>
|
||||
#if __cplusplus >= 201703L
|
||||
#if TOML11_CPLUSPLUS_STANDARD_VERSION >= 201703L
|
||||
#include <string_view>
|
||||
#endif
|
||||
|
||||
@@ -224,7 +224,7 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(test_get_string_type, value_type, test_value_types
|
||||
BOOST_TEST("foobar" == x);
|
||||
}
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#if TOML11_CPLUSPLUS_STANDARD_VERSION >= 201703L
|
||||
{
|
||||
value_type v("foo", toml::string_t::basic);
|
||||
BOOST_TEST("foo" == toml::get<std::string_view>(v));
|
||||
|
@@ -12,7 +12,7 @@
|
||||
#include <deque>
|
||||
#include <array>
|
||||
#include <tuple>
|
||||
#if __cplusplus >= 201703L
|
||||
#if TOML11_CPLUSPLUS_STANDARD_VERSION >= 201703L
|
||||
#include <string_view>
|
||||
#endif
|
||||
|
||||
|
@@ -133,7 +133,7 @@ BOOST_AUTO_TEST_CASE(test_string_add_assign)
|
||||
str += str2;
|
||||
BOOST_TEST(str.str == "foobar");
|
||||
}
|
||||
#if __cplusplus >= 201703L
|
||||
#if TOML11_CPLUSPLUS_STANDARD_VERSION >= 201703L
|
||||
// std::string_view
|
||||
{
|
||||
toml::string str("foo");
|
||||
|
@@ -9,7 +9,7 @@
|
||||
#include <map>
|
||||
#include <list>
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#if TOML11_CPLUSPLUS_STANDARD_VERSION >= 201703L
|
||||
#include <string_view>
|
||||
#endif
|
||||
|
||||
@@ -423,7 +423,7 @@ BOOST_AUTO_TEST_CASE(test_value_string)
|
||||
BOOST_TEST(v2.as_boolean() == true);
|
||||
BOOST_TEST(v3.as_boolean() == true);
|
||||
|
||||
#if __cplusplus >= 201703L
|
||||
#if TOML11_CPLUSPLUS_STANDARD_VERSION >= 201703L
|
||||
std::string_view sv = "foo";
|
||||
|
||||
toml::value v7(sv);
|
||||
|
Reference in New Issue
Block a user