diff --git a/src/util/ConstBuffer.hxx b/src/util/ConstBuffer.hxx index 51c19cc38..cb23cbe46 100644 --- a/src/util/ConstBuffer.hxx +++ b/src/util/ConstBuffer.hxx @@ -31,14 +31,7 @@ #include #include - -#if __cplusplus >= 202002 || (defined(__GNUC__) && __GNUC__ >= 10) -#include -#endif - -#ifdef __cpp_lib_span #include -#endif template struct ConstBuffer; @@ -63,10 +56,8 @@ struct ConstBuffer { constexpr ConstBuffer(pointer _data, size_type _size) noexcept :data(_data), size(_size) {} -#ifdef __cpp_lib_span constexpr ConstBuffer(std::span s) noexcept :data(s.data()), size(s.size()) {} -#endif constexpr static ConstBuffer FromVoid(ConstBuffer other) noexcept { return other; @@ -92,11 +83,9 @@ struct ConstBuffer { return size == 0; } -#ifdef __cpp_lib_span constexpr operator std::span() const noexcept { return {static_cast(data), size}; } -#endif }; /** @@ -134,10 +123,8 @@ struct ConstBuffer { constexpr ConstBuffer(const T (&_data)[_size]) noexcept :data(_data), size(_size) {} -#ifdef __cpp_lib_span constexpr ConstBuffer(std::span s) noexcept :data(s.data()), size(s.size()) {} -#endif /** * Cast a ConstBuffer to a ConstBuffer, rounding down @@ -292,9 +279,7 @@ struct ConstBuffer { size = new_end - data; } -#ifdef __cpp_lib_span constexpr operator std::span() const noexcept { return {data, size}; } -#endif };