1 #ifndef _OS_SMART_POINTER_H
2 #define _OS_SMART_POINTER_H
4 #include "os_object_base.h"
10 smart_ptr() : pointer(nullptr) {}
12 explicit smart_ptr(T
*&p
) : pointer(p
) {
18 smart_ptr(smart_ptr
const &rhs
) : pointer(rhs
.pointer
) {
24 smart_ptr
& operator=(T
*&rhs
) {
25 smart_ptr(rhs
).swap(*this);
29 smart_ptr
& operator=(smart_ptr
&rhs
) {
30 smart_ptr(rhs
).swap(*this);
41 smart_ptr().swap(*this);
48 T
** get_for_out_param() {
53 T
* operator->() const {
58 operator bool() const {
59 return pointer
!= nullptr;
88 #endif /* _OS_SMART_POINTER_H */