您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

19 行
311B

  1. #include "scope_guard.h"
  2. #include <catch.hpp>
  3. using namespace guards;
  4. TEST_CASE("deleter called on destruction", "[ScopeGuard]")
  5. {
  6. bool executed = false;
  7. {
  8. auto guard = scope_guard([&executed] { executed = true; });
  9. static_cast<void>(guard);
  10. }
  11. REQUIRE(executed == true);
  12. }