encoder/Interface: pass std::span to Write() and Read()

This commit is contained in:
Max Kellermann
2022-07-11 22:14:48 +02:00
parent 28e044a36a
commit 7e14f8f830
18 changed files with 118 additions and 115 deletions

View File

@@ -33,8 +33,6 @@
#include <stddef.h>
static uint8_t zero[256];
int
main([[maybe_unused]] int argc, [[maybe_unused]] char **argv)
try {
@@ -61,7 +59,8 @@ try {
/* write a block of data */
encoder->Write(zero, sizeof(zero));
static constexpr std::byte zero[256]{};
encoder->Write(std::span{zero});
EncoderToOutputStream(os, *encoder);
@@ -86,7 +85,7 @@ try {
/* write another block of data */
encoder->Write(zero, sizeof(zero));
encoder->Write(std::span{zero});
/* finish */