Skip to content

Commit 23b3195

Browse files
committed
Detect and use std::string_view on Visual Studio
1 parent 4a0a260 commit 23b3195

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

include/tao/json/external/string_view.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55
#define TAOCPP_INCLUDE_STRING_VIEW_HPP
66

77
#ifndef TAOCPP_USE_STD_STRING_VIEW
8-
#if __cplusplus >= 201703L
8+
#if( __cplusplus >= 201703L )
9+
#define TAOCPP_USE_STD_STRING_VIEW
10+
#elif defined( _MSC_VER ) && ( _MSC_VER >= 1910L )
911
#define TAOCPP_USE_STD_STRING_VIEW
1012
#endif
1113
#endif
1214

1315
#ifndef TAOCPP_USE_STD_STRING_VIEW
1416
#ifndef TAOCPP_USE_TS_STRING_VIEW
15-
#if( __cplusplus >= 201402L ) && ( ( __GNUC__ > 4 ) || ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ >= 9 ) )
17+
#if( __cplusplus >= 201402L ) && defined( __GNUC__ ) && ( ( __GNUC__ > 4 ) || ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ >= 9 ) )
1618
#define TAOCPP_USE_TS_STRING_VIEW
1719
#endif
1820
#endif

0 commit comments

Comments
 (0)