22 template <
typename Scalar>
void append(Scalar value) {
23 static_assert(std::is_trivially_copyable<Scalar>::value,
24 "PackedRecordBuffer appends raw bytes of trivially copyable scalars");
25 const std::size_t offset = bytes_.size();
26 bytes_.resize(offset +
sizeof(Scalar));
27 std::memcpy(bytes_.data() + offset, &value,
sizeof(Scalar));