From 66807d19d1feb424eaa3758271f587f85dc050e5 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Sat, 8 Dec 2018 19:40:58 +0900 Subject: [PATCH] add specializations --- toml/types.hpp | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/toml/types.hpp b/toml/types.hpp index a1b94e6..76418e1 100644 --- a/toml/types.hpp +++ b/toml/types.hpp @@ -104,16 +104,19 @@ constexpr inline value_t check_type() value_t::Unknown; } -template struct toml_default_type{}; -template<> struct toml_default_type{typedef Boolean type;}; -template<> struct toml_default_type{typedef Integer type;}; -template<> struct toml_default_type{typedef Float type;}; -template<> struct toml_default_type{typedef String type;}; -template<> struct toml_default_type{typedef Datetime type;}; -template<> struct toml_default_type{typedef Array type;}; -template<> struct toml_default_type{typedef Table type;}; -template<> struct toml_default_type{typedef void type;}; -template<> struct toml_default_type{typedef void type;}; +template struct toml_default_type; +template<> struct toml_default_type {typedef Boolean type;}; +template<> struct toml_default_type {typedef Integer type;}; +template<> struct toml_default_type {typedef Float type;}; +template<> struct toml_default_type {typedef String type;}; +template<> struct toml_default_type {typedef offset_datetime type;}; +template<> struct toml_default_type{typedef local_datetime type;}; +template<> struct toml_default_type {typedef local_date type;}; +template<> struct toml_default_type {typedef local_time type;}; +template<> struct toml_default_type {typedef Array type;}; +template<> struct toml_default_type {typedef Table type;}; +template<> struct toml_default_type {typedef void type;}; +template<> struct toml_default_type {typedef void type;}; template struct is_exact_toml_type : disjunction< @@ -121,10 +124,17 @@ struct is_exact_toml_type : disjunction< std::is_same, std::is_same, std::is_same, - std::is_same, + std::is_same, + std::is_same, + std::is_same, + std::is_same, std::is_same, std::is_same >{}; +template struct is_exact_toml_type : is_exact_toml_type{}; +template struct is_exact_toml_type : is_exact_toml_type{}; +template struct is_exact_toml_type : is_exact_toml_type{}; +template struct is_exact_toml_type: is_exact_toml_type{}; template struct is_map : conjunction< @@ -133,14 +143,23 @@ struct is_map : conjunction< has_key_type, has_mapped_type >{}; +template struct is_map : is_map{}; +template struct is_map : is_map{}; +template struct is_map : is_map{}; +template struct is_map : is_map{}; template struct is_container : conjunction< negation>, - negation>, + negation>, has_iterator, has_value_type >{}; +template struct is_container : is_container{}; +template struct is_container : is_container{}; +template struct is_container : is_container{}; +template struct is_container : is_container{}; + } // detail } // toml