14 stream <<
"The value of the object the ptr is pointing to = " << *ptr <<
endl;
19 auto ptr = std::make_unique<int>(10);
29 stream <<
"Ptr is still valid: " << *ptr <<
endl;
45 m_ptr{
std::make_unique<int>(value) } { }
64 return std::move(this->m_ptr);
74 auto ptr = std::make_unique<int>(value);
89 decltype(
auto) ptr2 = dummy.return_unique_ptr_reference();
91 stream <<
"The type of ptr1: "
94 stream <<
"The value of ptr1: "
97 stream <<
"The type of ptr2: "
100 stream <<
"The value of ptr2: "
106 auto ptr = std::make_unique<int>(value);
114 auto ptr = std::make_unique<int>(value);
116 return std::move(ptr);
125 stream <<
"the value of the object ptr is pointing to: "
138 stream <<
"the value of the object ptr is pointing to: "
143 stream <<
"dummy.m_ptr is still valid: "
144 << *dummy.m_ptr <<
endl;
167 stream <<
"The value of the object the ptr p is pointing to: "
void test_member_function_returning_member_unique_ptr()
void get_unique_ptr_from_a_function()
std::unique_ptr< int > make_int_ptr(int value)
void test_member_function_returning_unique_ptr()
void take_unique_ptr_by_reference(const std::unique_ptr< int > &ptr)
void test_return_unique_ptr_reference()
void test_pass_unique_ptr_by_reference()
std::unique_ptr< int > && return_rvalue_ref_unique_ptr(int value)
std::unique_ptr< int > m_ptr
std::unique_ptr< int > return_unique_ptr(int value)
std::unique_ptr< int > return_unique_ptr_of_member_data()
const std::unique_ptr< int > & return_unique_ptr_reference()
Stream output operators << are implemented.
#define Tpf_GetTypeCategory(instance_arg)
A macro that returns instance_arg's type category string name.