Skip to content

Commit df4821a

Browse files
Clownacyflamewing
authored andcommitted
std::data is C++17...
...this project is C++14.
1 parent 4d56fca commit df4821a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

include/mdcomp/bigendian_io.hh

+6-6
Original file line numberDiff line numberDiff line change
@@ -299,15 +299,15 @@ namespace detail {
299299
template <typename T>
300300
static inline void Read(std::istream& in, T& val) noexcept {
301301
alignas(alignof(T)) std::array<char, sizeof(T)> buffer;
302-
in.read(std::data(buffer), sizeof(T));
303-
std::memcpy(&val, std::data(buffer), sizeof(T));
302+
in.read(buffer.data(), sizeof(T));
303+
std::memcpy(&val, buffer.data(), sizeof(T));
304304
}
305305

306306
template <typename T>
307307
static inline void Read(std::streambuf& in, T& val) noexcept {
308308
alignas(alignof(T)) std::array<char, sizeof(T)> buffer;
309309
in.sgetn(std::begin(buffer), sizeof(T));
310-
std::memcpy(&val, std::data(buffer), sizeof(T));
310+
std::memcpy(&val, buffer.data(), sizeof(T));
311311
}
312312

313313
template <typename Iter, typename T>
@@ -321,15 +321,15 @@ namespace detail {
321321
template <typename T>
322322
static inline void Write(std::ostream& out, T val) noexcept {
323323
alignas(alignof(T)) std::array<char, sizeof(T)> buffer;
324-
std::memcpy(std::data(buffer), &val, sizeof(T));
325-
out.write(std::data(buffer), sizeof(T));
324+
std::memcpy(buffer.data(), &val, sizeof(T));
325+
out.write(buffer.data(), sizeof(T));
326326
}
327327

328328
template <typename T>
329329
static inline void Write(std::streambuf& out, T val) noexcept {
330330
alignas(alignof(T)) std::array<char, sizeof(T)> buffer;
331331
std::memcpy(std::begin(buffer), &val, sizeof(T));
332-
out.sputn(std::data(buffer), sizeof(T));
332+
out.sputn(buffer.data(), sizeof(T));
333333
}
334334

335335
template <typename Cont, typename T>

0 commit comments

Comments
 (0)