Skip to content

Commit

Permalink
console: Further tweaked printable_t types while trying to protect fr…
Browse files Browse the repository at this point in the history
…om slicing
  • Loading branch information
dragonmux committed Aug 21, 2023
1 parent b1823c1 commit 278f342
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions substrate/console
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 278f342

Please sign in to comment.