From 46577d0d2f297fb052d7ecae93521aae34a388ea Mon Sep 17 00:00:00 2001 From: Gleb Lamm Date: Sat, 18 Nov 2023 23:06:18 +0300 Subject: [PATCH] Fix: detect c++ standard on MSVC for span (#8155) --- include/flatbuffers/stl_emulation.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/flatbuffers/stl_emulation.h b/include/flatbuffers/stl_emulation.h index fd3a8cda71c..5f19eaf8d41 100644 --- a/include/flatbuffers/stl_emulation.h +++ b/include/flatbuffers/stl_emulation.h @@ -45,7 +45,8 @@ // Testing __cpp_lib_span requires including either or , // both of which were added in C++20. // See: https://en.cppreference.com/w/cpp/utility/feature_test - #if defined(__cplusplus) && __cplusplus >= 202002L + #if defined(__cplusplus) && __cplusplus >= 202002L \ + || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) #define FLATBUFFERS_USE_STD_SPAN 1 #endif #endif // FLATBUFFERS_USE_STD_SPAN