瀏覽代碼

Test case for unique resource with std::function deleter added.

main
offa 4 年之前
父節點
當前提交
d08bc6f8ca
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. +8
    -0
      test/UniqueResourceTest.cpp

+ 8
- 0
test/UniqueResourceTest.cpp 查看文件

@@ -237,3 +237,11 @@ TEST_CASE("noexcept move", "[UniqueResource]")
auto temp = std::move(guard);
guard = std::move(temp);
}

TEST_CASE("std::function deleter", "[UniqueResource]")
{
const auto deleter = std::function<void(Handle)>{[]([[maybe_unused]] Handle h) { }};
sr::unique_resource guard1{Handle{3}, deleter};
sr::unique_resource guard2{Handle{4}, deleter};
guard2 = std::move(guard1);
}

Loading…
取消
儲存