move is_chrono_duration from types to traits

This commit is contained in:
ToruNiina 2018-12-10 22:01:18 +09:00
parent 4e57c5f5df
commit 0759e757ae
2 changed files with 5 additions and 3 deletions

View File

@ -2,6 +2,7 @@
#define TOML11_TRAITS
#include <type_traits>
#include <utility>
#include <chrono>
#include <tuple>
namespace toml
@ -85,6 +86,10 @@ template<typename T> struct is_std_tuple : std::false_type{};
template<typename ... Ts>
struct is_std_tuple<std::tuple<Ts...>> : std::true_type{};
template<typename T> struct is_chrono_duration: std::false_type{};
template<typename Rep, typename Period>
struct is_chrono_duration<std::chrono::duration<Rep, Period>>: std::true_type{};
// to use toml::get<std::tuple<T1, T2, ...>> in C++11
template<std::size_t ... Ns> struct index_sequence{};

View File

@ -82,9 +82,6 @@ inline std::basic_string<charT, traits, alloc> stringize(value_t t)
namespace detail
{
template<typename T> struct is_chrono_duration: std::false_type{};
template<typename Rep, typename Period>
struct is_chrono_duration<std::chrono::duration<Rep, Period>>: std::true_type{};
template<typename T>
constexpr inline value_t check_type()