summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-08-23 07:06:40 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-08-23 07:06:40 +0000
commit27339377a5fea608598960ec9d576673c2b64b55 (patch)
tree9604cac5e305d2dfd88b303d7c862d7118209f58 /vespalib
parentda2a54fc4abdd31a783ed63292ea7f9c3c5cc551 (diff)
Add final
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/vespa/vespalib/util/stash.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/vespalib/src/vespa/vespalib/util/stash.h b/vespalib/src/vespa/vespalib/util/stash.h
index 990f69fe4ed..2be352e6381 100644
--- a/vespalib/src/vespa/vespalib/util/stash.h
+++ b/vespalib/src/vespa/vespalib/util/stash.h
@@ -29,13 +29,15 @@ struct DeleteMemory final : public Cleanup {
};
// used as prefix for objects to be destructed
-template<typename T> struct DestructObject : public Cleanup {
+template<typename T>
+struct DestructObject final : public Cleanup {
explicit DestructObject(Cleanup *next_in) noexcept : Cleanup(next_in) {}
void cleanup() override { reinterpret_cast<T*>(this + 1)->~T(); }
};
// used as prefix for arrays to be destructed
-template<typename T> struct DestructArray : public Cleanup {
+template<typename T>
+struct DestructArray final : public Cleanup {
size_t size;
explicit DestructArray(Cleanup *next_in, size_t size_in) noexcept
: Cleanup(next_in), size(size_in) {}