Skip to content

Commit 8abea09

Browse files
authored
Make the std::string_view work on windows (#256)
1 parent 9736ab7 commit 8abea09

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

trantor/utils/LogStream.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <string.h> // memcpy
2323
#include <string>
2424

25-
#if __cplusplus >= 201703L
25+
#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
2626
#include <string_view>
2727
#endif
2828

@@ -204,10 +204,10 @@ class TRANTOR_EXPORT LogStream : NonCopyable
204204
append(v.c_str(), v.size());
205205
return *this;
206206
}
207-
#if __cplusplus >= 201703L
207+
#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
208208
self &operator<<(const std::string_view v)
209209
{
210-
append(v.begin(), v.size());
210+
append(v.data(), v.length());
211211
return *this;
212212
}
213213
#endif

0 commit comments

Comments
 (0)