From 4832ea0ddb844ee9752bde42a6ce1441bc5ae09e Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Fri, 17 Nov 2017 11:08:39 -0500 Subject: [PATCH] Move HAS_STRING_VIEW to date.h --- include/date/date.h | 12 +++++++++++- include/date/tz.h | 8 -------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/include/date/date.h b/include/date/date.h index 1bad46d..c97936d 100644 --- a/include/date/date.h +++ b/include/date/date.h @@ -30,8 +30,15 @@ // been invented (that would involve another several millennia of evolution). // We did not mean to shout. -#include +#ifndef HAS_STRING_VIEW +# if __cplusplus >= 201703 +# define HAS_STRING_VIEW 1 +# else +# define HAS_STRING_VIEW 0 +# endif +#endif // HAS_STRING_VIEW +#include #include #include #include @@ -53,6 +60,9 @@ #include #include #include +#if HAS_STRING_VIEW +# include +#endif #include #include diff --git a/include/date/tz.h b/include/date/tz.h index d85d6f9..532fe69 100644 --- a/include/date/tz.h +++ b/include/date/tz.h @@ -104,14 +104,6 @@ static_assert(HAS_REMOTE_API == 0 ? AUTO_DOWNLOAD == 0 : true, # endif #endif // HAS_DEDUCTION_GUIDES -#ifndef HAS_STRING_VIEW -# if __cplusplus >= 201703 -# define HAS_STRING_VIEW 1 -# else -# define HAS_STRING_VIEW 0 -# endif -#endif // HAS_STRING_VIEW - #include "date.h" #if defined(_MSC_VER) && (_MSC_VER < 1900)