12 #ifndef DOCWIRE_PIMPL_H
13 #define DOCWIRE_PIMPL_H
42 template <
typename... Args>
47 static_assert(std::is_constructible_v<impl_type, T&, Args...>,
48 "Template specialization of pimpl_impl<T> that inherits from with_pimpl_owner<T> is required to have constructor with T&, Args... arguments");
49 return new impl_type(
static_cast<T&
>(*
this), std::forward<Args>(args)...);
53 static_assert(std::is_constructible_v<impl_type, Args...>,
54 "Template specialization of pimpl_impl<T> is required to have constructor with Args... arguments");
55 return new impl_type(std::forward<Args>(args)...);
59 template <
typename... Args>
61 : m_impl(
static_cast<pimpl_impl_base*
>(create_impl(std::forward<Args>(args)...)))
66 : m_impl(std::move(other.m_impl))
77 m_impl = std::move(other.m_impl);
84 template <
typename DeferInstantiation =
void>
87 template <
typename DeferInstantiation =
void>
91 std::unique_ptr<pimpl_impl_base> m_impl;
95 m_impl->set_owner(*
this);
104 T& owner() {
return m_owner; }
105 const T& owner()
const {
return m_owner; }
109 m_owner =
static_cast<T&
>(
static_cast<with_pimpl<T>&
>(owner));
113 std::reference_wrapper<T> m_owner;
The main namespace for the DocWire SDK.