aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/serialise.hh
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-07-22 17:15:57 +0200
committereldritch horrors <pennae@lix.systems>2024-07-22 16:26:55 +0000
commitc74eb81356ef0e202713111d621434e46edc27ea (patch)
treea292f39326e0da00685d8d7071789dcd82261187 /src/libutil/serialise.hh
parent0463cf2aefafcbf3762ffdfa6df3f1eb8fa21bfd (diff)
enable -Werror=suggest-override
*accidentally* overriding a function is almost guaranteed to be an error. overriding a function without labeling it as such is merely bad style, but bad style that makes the code harder to understand. Change-Id: Ic0594f3d1604ab6b3c1a75cb5facc246effe45f0
Diffstat (limited to 'src/libutil/serialise.hh')
-rw-r--r--src/libutil/serialise.hh8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libutil/serialise.hh b/src/libutil/serialise.hh
index 9b1892bbb..6c637bd35 100644
--- a/src/libutil/serialise.hh
+++ b/src/libutil/serialise.hh
@@ -211,7 +211,7 @@ struct TeeSink : Sink
{
Sink & sink1, & sink2;
TeeSink(Sink & sink1, Sink & sink2) : sink1(sink1), sink2(sink2) { }
- virtual void operator () (std::string_view data)
+ virtual void operator () (std::string_view data) override
{
sink1(data);
sink2(data);
@@ -228,7 +228,7 @@ struct TeeSource : Source
Sink & sink;
TeeSource(Source & orig, Sink & sink)
: orig(orig), sink(sink) { }
- size_t read(char * data, size_t len)
+ size_t read(char * data, size_t len) override
{
size_t n = orig.read(data, len);
sink({data, n});
@@ -245,7 +245,7 @@ struct SizedSource : Source
size_t remain;
SizedSource(Source & orig, size_t size)
: orig(orig), remain(size) { }
- size_t read(char * data, size_t len)
+ size_t read(char * data, size_t len) override
{
if (this->remain <= 0) {
throw EndOfFile("sized: unexpected end-of-file");
@@ -338,7 +338,7 @@ struct GeneratorSource : Source
{
GeneratorSource(Generator<Bytes> && g) : g(std::move(g)) {}
- virtual size_t read(char * data, size_t len)
+ virtual size_t read(char * data, size_t len) override
{
// we explicitly do not poll the generator multiple times to fill the
// buffer, only to produce some output at all. this is allowed by the