![]() |
C++ Library Extensions 2022.12.09
To help learn modern C++ programming
|
Public Types | |
using | uptr_t = std::unique_ptr< ElementType > |
using | sptr_t = std::shared_ptr< ElementType > |
using | usptr_t = std::variant< uptr_t, sptr_t > |
Public Member Functions | |
smarter_ptr (ElementType value=ElementType{}) | |
smarter_ptr (const smarter_ptr &)=delete | |
smarter_ptr & | operator= (const smarter_ptr &)=delete |
smarter_ptr (smarter_ptr &&rhs) | |
smarter_ptr & | operator= (smarter_ptr &&rhs) |
bool | is_unique_ptr () |
bool | is_shared_ptr () |
ElementType * | get () |
smarter_ptr & | operator= (ElementType value) |
smarter_ptr & | to_shared_ptr () |
smarter_ptr & | to_unique_ptr () |
Friends | |
tpf::sstream & | operator<< (tpf::sstream &os, const smarter_ptr &sp) |
Definition at line 126 of file 06-unique_ptr.cpp.
using smarter_ptr< ElementType >::sptr_t = std::shared_ptr<ElementType> |
Definition at line 130 of file 06-unique_ptr.cpp.
using smarter_ptr< ElementType >::uptr_t = std::unique_ptr<ElementType> |
Definition at line 129 of file 06-unique_ptr.cpp.
using smarter_ptr< ElementType >::usptr_t = std::variant<uptr_t, sptr_t> |
Definition at line 131 of file 06-unique_ptr.cpp.
|
inline |
Definition at line 137 of file 06-unique_ptr.cpp.
|
delete |
|
inline |
Definition at line 144 of file 06-unique_ptr.cpp.
|
inline |
Definition at line 173 of file 06-unique_ptr.cpp.
|
inline |
Definition at line 165 of file 06-unique_ptr.cpp.
|
inline |
Definition at line 157 of file 06-unique_ptr.cpp.
|
delete |
|
inline |
Definition at line 183 of file 06-unique_ptr.cpp.
|
inline |
Definition at line 146 of file 06-unique_ptr.cpp.
|
inline |
Definition at line 203 of file 06-unique_ptr.cpp.
|
inline |
Definition at line 217 of file 06-unique_ptr.cpp.
|
friend |
Definition at line 237 of file 06-unique_ptr.cpp.