From 26a066ad073e1f61a6cfe5f8fe49d767966c4a7c Mon Sep 17 00:00:00 2001 From: Philip Top Date: Thu, 19 Dec 2019 12:40:22 -0800 Subject: [PATCH] skip ci ci skip update another string_view issue --- CMakeLists.txt | 4 ++++ toml/string.hpp | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 49b665d..ce0e811 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,9 @@ cmake_minimum_required(VERSION 3.1) enable_testing() +if("${CMAKE_VERSION}" VERSION_GREATER 3.1) + project(toml11 VERSION 3.2.0) +else() + project(toml11) project(toml11 VERSION 3.7.0) diff --git a/toml/string.hpp b/toml/string.hpp index a6ed080..5136d8c 100644 --- a/toml/string.hpp +++ b/toml/string.hpp @@ -9,6 +9,7 @@ #if __cplusplus >= 201703L #if __has_include() +#define TOML11_USING_STRING_VIEW 1 #include #endif #endif @@ -53,7 +54,7 @@ struct string string& operator+=(const std::string& rhs) {str += rhs; return *this;} string& operator+=(const string& rhs) {str += rhs.str; return *this;} -#if __cplusplus >= 201703L +#if defined(TOML11_USING_STRING_VIEW) && TOML11_USING_STRING_VIEW>0 explicit string(std::string_view s): kind(string_t::basic), str(s){} string(std::string_view s, string_t k): kind(k), str(s){}