瀏覽代碼

Deduction guide for scope_exit implemented (#80).

main
offa 7 年之前
父節點
當前提交
44830430ab
共有 2 個檔案被更改,包括 5 行新增1 行删除
  1. +4
    -0
      include/scope_exit.h
  2. +1
    -1
      test/ScopeExitTest.cpp

+ 4
- 0
include/scope_exit.h 查看文件

@@ -52,6 +52,10 @@ namespace sr
};


template <class EF>
scope_exit(EF &&ef) -> scope_exit<std::decay_t<EF>>;


template<class EF>
scope_exit<std::decay_t<EF>> make_scope_exit(EF&& exitFunction)
{

+ 1
- 1
test/ScopeExitTest.cpp 查看文件

@@ -39,7 +39,7 @@ namespace
TEST_CASE("exit function called on destruction", "[ScopeExit]")
{
REQUIRE_CALL(m, deleter());
auto guard = sr::make_scope_exit(deleter);
auto guard = sr::scope_exit(deleter);
static_cast<void>(guard);
}


Loading…
取消
儲存