16template <
typename WrapperType>
19 static_assert(
sizeof(WrapperType) ==
sizeof(std::unique_ptr<ConnectionBase>));
26 : connectionPtr_(this) {}
36 assert(connectionPtr_ !=
nullptr);
38 return static_cast<WrapperType*
>(
static_cast<void*
>(&connectionPtr_));
41 [[nodiscard]] WrapperType&
wrapper() noexcept {
50 std::unique_ptr<ConnectionBase, NoDeleter> connectionPtr_;
Helper base class to derive a wrapper (e.g.
~ConnectionBase()=default
ConnectionBase(ConnectionBase &&) noexcept=delete
ConnectionBase() noexcept
WrapperType * wrapperPtr() noexcept
WrapperType & wrapper() noexcept
ConnectionBase(const ConnectionBase &)=delete