From 278f342b6a63b3d19b8e77064d5ae463e96d61f4 Mon Sep 17 00:00:00 2001 From: dragonmux Date: Mon, 21 Aug 2023 16:48:51 +0100 Subject: [PATCH] console: Further tweaked printable_t types while trying to protect from slicing --- substrate/console | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/substrate/console b/substrate/console index e5b31dfb..34a4f21c 100644 --- a/substrate/console +++ b/substrate/console @@ -38,10 +38,11 @@ namespace substrate virtual void operator()(const consoleStream_t &) const noexcept = 0; virtual ~printable_t() noexcept = default; - printable_t(const printable_t &) = delete; - printable_t(printable_t &&) = delete; - printable_t &operator =(const printable_t &) = delete; - printable_t &operator =(printable_t &&) = delete; + protected: + printable_t(const printable_t &) = default; + printable_t(printable_t &&) = default; + printable_t &operator =(const printable_t &) = default; + printable_t &operator =(printable_t &&) = default; }; struct SUBSTRATE_CLS_API consoleStream_t final @@ -227,7 +228,7 @@ namespace substrate constexpr asInt_t(const int_t value) noexcept : value_{value} { } constexpr asInt_t(const asInt_t &) noexcept = default; constexpr asInt_t(asInt_t &&) noexcept = default; - ~asInt_t() noexcept = default; + ~asInt_t() noexcept final = default; SUBSTRATE_CXX17_CONSTEXPR asInt_t &operator =(const asInt_t &) noexcept = default; SUBSTRATE_CXX17_CONSTEXPR asInt_t &operator =(asInt_t &&) noexcept = default; void operator()(const consoleStream_t &stream) const noexcept final @@ -264,7 +265,7 @@ namespace substrate constexpr asHex_t(const asHex_t &) noexcept = default; constexpr asHex_t(asHex_t &&) noexcept = default; - ~asHex_t() noexcept = default; + ~asHex_t() noexcept final = default; SUBSTRATE_CXX17_CONSTEXPR asHex_t &operator =(const asHex_t &) noexcept = default; SUBSTRATE_CXX17_CONSTEXPR asHex_t &operator =(asHex_t &&) noexcept = default; @@ -342,7 +343,7 @@ namespace substrate constexpr asTime_t(const uint64_t _value) noexcept : value{_value} { } constexpr asTime_t(const asTime_t &) noexcept = default; constexpr asTime_t(asTime_t &&) noexcept = default; - ~asTime_t() noexcept = default; + ~asTime_t() noexcept final = default; SUBSTRATE_CXX17_CONSTEXPR asTime_t &operator =(const asTime_t &) noexcept = default; SUBSTRATE_CXX17_CONSTEXPR asTime_t &operator =(asTime_t &&) noexcept = default;