 |
Documentation of CSL
|
Go to the documentation of this file. 24 #define INHERIT_SHARED_PTR_CONSTRUCTOR(Class, type)\ 25 template<class ...Args> \ 26 using _Constructible \ 27 = std::shared_ptr<type>::_Constructible<Args...>; \ 30 = std::shared_ptr<type>::_Assignable<Arg>; \ 32 constexpr Class(): std::shared_ptr<type>() {}; \ 34 template< class Y , class = _Constructible<Y*> > \ 35 explicit Class( Y* ptr ) \ 36 :std::shared_ptr<type>(ptr) {} \ 38 template< class Y, class Deleter, \ 39 class = _Constructible<Y*, Deleter> > \ 40 Class( Y* ptr, Deleter d ) \ 41 :std::shared_ptr<type>(ptr, d) {} \ 43 template< class Y, class Deleter, class Alloc, \ 44 class = _Constructible<Y*, Deleter, Alloc> > \ 45 Class( Y* ptr, Deleter d, Alloc alloc ) \ 46 :std::shared_ptr<type>(ptr, d, alloc) {} \ 48 constexpr Class( std::nullptr_t ) \ 49 :std::shared_ptr<type>(nullptr) {} \ 51 template< class Deleter > \ 52 Class( std::nullptr_t, Deleter d ) \ 53 :std::shared_ptr<type>(nullptr, d) {} \ 55 template< class Deleter, class Alloc > \ 56 Class( std::nullptr_t, Deleter d, Alloc alloc ) \ 57 :std::shared_ptr<type>(nullptr, d, alloc) {} \ 60 Class( const shared_ptr<Y>& r, type *ptr ) \ 61 :std::shared_ptr<type>(r, ptr) {} \ 63 Class( const shared_ptr<type>& r ) \ 64 :std::shared_ptr<type>(r) {} \ 66 template< class Y , class = _Constructible<const std::shared_ptr<Y>&> > \ 67 Class( const shared_ptr<Y>& r ) \ 68 :std::shared_ptr<type>(r) {} \ 70 Class( shared_ptr<type>&& r ) \ 71 :std::shared_ptr<type>(r) {} \ 73 template< class Y, class = _Constructible<std::shared_ptr<Y>> > \ 74 Class( shared_ptr<Y>&& r ) \ 75 :std::shared_ptr<type>(r) {} \ 77 template< class Y, class = _Constructible<const std::weak_ptr<Y>&> > \ 78 explicit Class( const std::weak_ptr<Y>& r ) \ 79 :std::shared_ptr<type>(r) {} \ 81 template< class Y, class Deleter, \ 82 class = _Constructible<std::unique_ptr<Y, Deleter>> > \ 83 Class( std::unique_ptr<Y,Deleter>&& r ) \ 84 :std::shared_ptr<type>(std::move(r)) {} 86 #define DEFINE_SHARED_PTR_OPERATOR(Class)\ 87 inline bool operator==( \ 92 return expr.get() == nullptr; \ 94 inline bool operator==( \ 99 return expr.get() == nullptr; \ 101 inline bool operator!=( \ 106 return expr.get() != nullptr; \ 108 inline bool operator!=( \ 113 return expr.get() != nullptr; \