From df4821a0e8f5eba26d7f10223a4a6e660edb3bff Mon Sep 17 00:00:00 2001 From: Clownacy Date: Fri, 9 Aug 2024 01:26:53 +0100 Subject: [PATCH] std::data is C++17... ...this project is C++14. --- include/mdcomp/bigendian_io.hh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/mdcomp/bigendian_io.hh b/include/mdcomp/bigendian_io.hh index 8f0f482..e236a19 100644 --- a/include/mdcomp/bigendian_io.hh +++ b/include/mdcomp/bigendian_io.hh @@ -299,15 +299,15 @@ namespace detail { template static inline void Read(std::istream& in, T& val) noexcept { alignas(alignof(T)) std::array buffer; - in.read(std::data(buffer), sizeof(T)); - std::memcpy(&val, std::data(buffer), sizeof(T)); + in.read(buffer.data(), sizeof(T)); + std::memcpy(&val, buffer.data(), sizeof(T)); } template static inline void Read(std::streambuf& in, T& val) noexcept { alignas(alignof(T)) std::array buffer; in.sgetn(std::begin(buffer), sizeof(T)); - std::memcpy(&val, std::data(buffer), sizeof(T)); + std::memcpy(&val, buffer.data(), sizeof(T)); } template @@ -321,15 +321,15 @@ namespace detail { template static inline void Write(std::ostream& out, T val) noexcept { alignas(alignof(T)) std::array buffer; - std::memcpy(std::data(buffer), &val, sizeof(T)); - out.write(std::data(buffer), sizeof(T)); + std::memcpy(buffer.data(), &val, sizeof(T)); + out.write(buffer.data(), sizeof(T)); } template static inline void Write(std::streambuf& out, T val) noexcept { alignas(alignof(T)) std::array buffer; std::memcpy(std::begin(buffer), &val, sizeof(T)); - out.sputn(std::data(buffer), sizeof(T)); + out.sputn(buffer.data(), sizeof(T)); } template