Skip to content

Commit

Permalink
Fix: detect c++ standard on MSVC for span (google#8155)
Browse files Browse the repository at this point in the history
  • Loading branch information
assorted authored and urshanselmann committed Dec 10, 2023
1 parent 0100f6a commit 0ada442
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/flatbuffers/stl_emulation.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
// Testing __cpp_lib_span requires including either <version> or <span>,
// 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
Expand Down

0 comments on commit 0ada442

Please sign in to comment.