Skip to content

Commit e0299bd

Browse files
author
Marc Emmers
committed
Use original <span> if present and the right version
1 parent 1dac20c commit e0299bd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

platform/cxxsupport/mstd_span

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@
1717
#ifndef MSTD_SPAN_
1818
#define MSTD_SPAN_
1919

20+
#if __cplusplus >= 201703L && __has_include(<span>)
21+
#include <version>
22+
#endif
23+
24+
#if __cpp_lib_span >= 202002L
25+
#include <span>
26+
27+
namespace mstd {
28+
using std::span;
29+
}
30+
31+
#else //__cpp_lib_span >= 202002L
32+
2033
#include <array>
2134
#include <mstd_iterator>
2235
#include <mstd_type_traits>
@@ -364,4 +377,5 @@ constexpr span<const typename R::value_type> make_span(const R &cont)
364377

365378
} // namespace mstd
366379

380+
#endif //__cpp_lib_span >= 202002L
367381
#endif // MSTD_SPAN_

0 commit comments

Comments
 (0)