2 #ifndef vbl_shared_pointer_h_ 3 #define vbl_shared_pointer_h_ 16 # include <vcl_msvc_warnings.h> 19 #define vbl_shared_pointer_zero(var) (var) = 0 98 : data(new
data_t(new T(v1), 1)) { }
100 template <
class V1,
class V2>
102 : data(new
data_t(new T(v1, v2), 1)) { }
104 template <
class V1,
class V2,
class V3>
106 : data(new
data_t(new T(v1, v2, v3), 1)) { }
108 template <
class V1,
class V2,
class V3,
class V4>
110 : data(new
data_t(new T(v1, v2, v3, v4), 1)) { }
129 explicit operator bool ()
const 130 {
return (
pointer != 0)? true :
false; }
134 {
return (
pointer != 0)? false :
true; }
137 #if !defined VBL_SHARED_POINTER_OF_NON_COMPOUND // Get rid of warning with vbl_shared_pointer<int> 170 #define VBL_SHARED_POINTER_INSTANTIATE(T) // template class vbl_shared_pointer<T > 172 #endif // vbl_shared_pointer_h_ self & operator=(self const &that)
T * pointer
pointer to object.
vbl_shared_pointer(vbl_shared_pointer< U > const &that)
Construct using smart pointer to derived class.
self & operator=(vbl_shared_pointer< U > const &that)
bool operator!=(self const &that) const
Non-intrusive smart pointers.
vbl_shared_pointer(self const &that)
bool operator<(self const &that) const
T const & operator *() const
vbl_shared_pointer_data(int u)
int use_count
number of shared_pointers using object.
T const * operator->() const
vbl_shared_pointer_data data_t
bool operator==(self const &that) const