feat: do not consider string_view as a container

it is a kind of string.
This commit is contained in:
ToruNiina
2019-04-23 23:23:57 +09:00
parent 62cf4373bd
commit 0c7d2d07d4

View File

@@ -7,6 +7,11 @@
#include "traits.hpp" #include "traits.hpp"
#include <vector> #include <vector>
#include <unordered_map> #include <unordered_map>
#if __cplusplus >= 201703L
#if __has_include(<string_view>)
#include <string_view>
#endif
#endif
namespace toml namespace toml
{ {
@@ -172,6 +177,9 @@ template<typename T>
struct is_container : conjunction< struct is_container : conjunction<
negation<is_map<T>>, negation<is_map<T>>,
negation<std::is_same<T, std::string>>, negation<std::is_same<T, std::string>>,
#if __cplusplus >= 201703L
negation<std::is_same<T, std::string_view>>,
#endif
has_iterator<T>, has_iterator<T>,
has_value_type<T> has_value_type<T>
>{}; >{};