Skip to content

Commit

Permalink
Fix gsl/util for c++20 compilers without <span>
Browse files Browse the repository at this point in the history
For instance, clang 10 sets __cplusplus >= 202002L yet does not have span, which causes build errors: 

https://gcc.godbolt.org/z/Yq345zGea
  • Loading branch information
jcelerier authored Sep 6, 2021
1 parent 8a4b9ed commit 83acddc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/gsl/util
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
#include <utility> // for exchange, forward

#if defined(__cplusplus) && __cplusplus >= 202002L
#include <version>
#if defined(__cpp_lib_span) && __cpp_lib_span >= 202002L
#include <span>
#endif // __cpp_lib_span >= 202002L
#endif // __cplusplus >= 202002L

#if defined(_MSC_VER) && !defined(__clang__)
Expand Down

0 comments on commit 83acddc

Please sign in to comment.