8 #include "opentelemetry/version.h"
13 #if defined __has_include
14 # if __has_include(<version>) // Check for __cpp_{feature}
16 # if defined(__cpp_lib_span) && __cplusplus > 201703L
17 # define OPENTELEMETRY_HAVE_SPAN
20 # if !defined(OPENTELEMETRY_HAVE_SPAN)
21 # // Check for Visual Studio span
22 # if defined(_MSVC_LANG) && _HAS_CXX20
23 # define OPENTELEMETRY_HAVE_SPAN
25 # // Check for other compiler span implementation
26 # if !defined(_MSVC_LANG) && __has_include(<span>) && __cplusplus > 201703L
28 # define OPENTELEMETRY_HAVE_SPAN
31 # if !__has_include(<gsl/gsl>)
36 #if !defined(OPENTELEMETRY_HAVE_SPAN)
37 # if defined(HAVE_GSL)
38 # include <type_traits>
45 template <
class ElementType, std::
size_t Extent = gsl::dynamic_extent>
46 using span = gsl::span<ElementType, Extent>;
49 # define OPENTELEMETRY_HAVE_SPAN
54 #else // OPENTELEMETRY_HAVE_SPAN
67 template <
class ElementType, std::
size_t Extent = nostd::dynamic_extent>
68 using span = std::span<ElementType, Extent>;
71 #endif // if OPENTELEMETRY_HAVE_SPAN