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

18 行
287B

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