impl_ptr
// In header: <impl_ptr.hpp> template<typename user_type, template< typename, typename... > class PT = detail::no_policy, typename... more_types> struct impl_ptr { // types typedef impl_ptr< user_type, impl_ptr_policy::inplace, MT... > inplace; typedef impl_ptr< user_type, impl_ptr_policy::shared > shared; typedef impl_ptr< user_type, impl_ptr_policy::unique > unique; typedef impl_ptr< user_type, impl_ptr_policy::copied > copied; typedef impl_ptr impl_ptr_type; typedef typename impl_ptr< user_type >::implementation impl_type; typedef PT< impl_type, more_types... > policy_type; // construct/copy/destruct impl_ptr(impl_ptr const &) = default; impl_ptr(impl_ptr &&) = default; impl_ptr(std::nullptr_t); template<typename... arg_types> impl_ptr(detail::in_place_type, arg_types &&...); impl_ptr & operator=(impl_ptr const &) = default; impl_ptr & operator=(impl_ptr &&) = default; ~impl_ptr(); // public static functions static user_type null(); // public member functions bool operator!() const; explicit operator bool() const; bool operator==(user_type const &) const; bool operator!=(user_type const &) const; bool operator<(user_type const &) const; void swap(user_type &); long use_count() const; template<typename derived_impl_type, typename... arg_types> void emplace(arg_types &&...); template<typename... arg_types> void emplace(arg_types &&...); impl_type * operator->() const; impl_type & operator*() const; // public data members static constexpr detail::in_place_type in_place; };
impl_ptr
public member functionsbool operator!() const;
explicit operator bool() const;
bool operator==(user_type const & that) const;
bool operator!=(user_type const & that) const;
bool operator<(user_type const & that) const;
void swap(user_type & that);
long use_count() const;
template<typename derived_impl_type, typename... arg_types> void emplace(arg_types &&... args);
template<typename... arg_types> void emplace(arg_types &&... args);
impl_type * operator->() const;
impl_type & operator*() const;