Skip to content

Commit

Permalink
Use original <span> if present and the right version
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Emmers committed Jan 16, 2021
1 parent 1dac20c commit e0299bd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions platform/cxxsupport/mstd_span
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
#ifndef MSTD_SPAN_
#define MSTD_SPAN_

#if __cplusplus >= 201703L && __has_include(<span>)
#include <version>
#endif

#if __cpp_lib_span >= 202002L
#include <span>

namespace mstd {
using std::span;
}

#else //__cpp_lib_span >= 202002L

#include <array>
#include <mstd_iterator>
#include <mstd_type_traits>
Expand Down Expand Up @@ -364,4 +377,5 @@ constexpr span<const typename R::value_type> make_span(const R &cont)

} // namespace mstd

#endif //__cpp_lib_span >= 202002L
#endif // MSTD_SPAN_

0 comments on commit e0299bd

Please sign in to comment.