From: Bartosz Golaszewski Date: Mon, 27 Feb 2023 10:03:50 +0000 (+0100) Subject: bindings: cxx: make edge_event's impl struct implementations final X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=419c39ee7a71f7f7b859a1d5d51b8f04cb9df3b4;p=qemu-gpiodev%2Flibgpiod.git bindings: cxx: make edge_event's impl struct implementations final 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 --- diff --git a/bindings/cxx/internal.hpp b/bindings/cxx/internal.hpp index ef239d4..db78af6 100644 --- a/bindings/cxx/internal.hpp +++ b/bindings/cxx/internal.hpp @@ -185,12 +185,12 @@ struct edge_event::impl virtual ::std::shared_ptr copy(const ::std::shared_ptr& 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;