return m_resource; | return m_resource; | ||||
} | } | ||||
const D& get_deleter() const noexcept | |||||
{ | |||||
return m_deleter; | |||||
} | |||||
unique_resource& operator=(unique_resource&& other); | |||||
unique_resource& operator=(unique_resource&& other); // TODO: Implement | |||||
unique_resource& operator=(const unique_resource&) = delete; | unique_resource& operator=(const unique_resource&) = delete; | ||||
CHECK(guard.get() == 3); | CHECK(guard.get() == 3); | ||||
} | } | ||||
// TODO: Pointer access functions | |||||
TEST_CASE("deleter access", "[UniqueResource]") | |||||
{ | |||||
auto guard = sr::make_unique_resource(Handle{3}, deleter); | |||||
guard.release(); | |||||
{ | |||||
REQUIRE_CALL(m, deleter(8)); | |||||
guard.get_deleter()(8); | |||||
} | |||||
} |