15 auto ptr = obj->ref();
32 auto ptr3 = std::move(ptr2);
45 auto cptr3 = std::move(cptr2);
67 auto ptr = obj->ref();
86 auto ptr3 = std::move(ptr2);
99 auto cptr3 = std::move(cptr2);
126 auto up = std::unique_ptr<int>(std::move(rp));
128 up = std::move(op).to_unique();
131 op.reset(up.release(),
true);
142 std::unique_ptr<
int,
decltype(+del)>(
new int{42}, del));
154 auto up = std::unique_ptr<int, decltype(+del)>(std::move(rp));
156 up = std::move(op).to_unique();
159 op.reset(up.release(),
true, up.get_deleter());
170 std::unique_ptr<
int,
decltype(*+del)>(
new int{42}, *del));
182 auto up = std::unique_ptr<int, decltype(*+del)>(std::move(rp));
200 auto up = std::unique_ptr<int[]>(std::move(rp));
202 up = std::move(op).to_unique();
205 op.reset(up.release(),
true);
#define REQUIRE_FALSE(...)
This header provides some features of C++17 <type_traits> and other headers for C++14,...
TEST_CASE("live_ptr<int>")
Provides utilities to enable safe and expressive memory management and low-level memory manipulation.
std::unique_ptr< T > make_unique(Args &&... args)
constexpr auto a(const std::initializer_list< T > &a) -> auto
Index an array literal without naming its type.
auto make_cond_ptr(std::unique_ptr< T, Deleter > &&arg) noexcept -> cond_ptr< T, Deleter >
auto to_unique(owner< T * > p) -> std::unique_ptr< T >