bindings: cxx: make edge_event's impl struct implementations final
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 27 Feb 2023 10:03:50 +0000 (11:03 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Fri, 3 Mar 2023 14:04:32 +0000 (15:04 +0100)
The implementations of the abstract edge_event's base impl private struct
can be made final and their destructors non-virtual. As these types are
entirely private, it does not affect the ABI.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
bindings/cxx/internal.hpp

index ef239d4c45c79af6649cf65dbf989abe32568f0a..db78af6e718303c6c7f05f0fb3ec27b3113344a6 100644 (file)
@@ -185,12 +185,12 @@ struct edge_event::impl
        virtual ::std::shared_ptr<impl> copy(const ::std::shared_ptr<impl>& self) const = 0;
 };
 
-struct edge_event::impl_managed : public edge_event::impl
+struct edge_event::impl_managed final : public edge_event::impl
 {
        impl_managed() = default;
        impl_managed(const impl_managed& other) = delete;
        impl_managed(impl_managed&& other) = delete;
-       virtual ~impl_managed() = default;
+       ~impl_managed() = default;
        impl_managed& operator=(const impl_managed& other) = delete;
        impl_managed& operator=(impl_managed&& other) = delete;
 
@@ -200,12 +200,12 @@ struct edge_event::impl_managed : public edge_event::impl
        edge_event_ptr event;
 };
 
-struct edge_event::impl_external : public edge_event::impl
+struct edge_event::impl_external final : public edge_event::impl
 {
        impl_external();
        impl_external(const impl_external& other) = delete;
        impl_external(impl_external&& other) = delete;
-       virtual ~impl_external() = default;
+       ~impl_external() = default;
        impl_external& operator=(const impl_external& other) = delete;
        impl_external& operator=(impl_external&& other) = delete;