浏览代码

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);
}

正在加载...
取消
保存