SCOPE_SUCCESS should be able to throw, the others shouldn't
authorAndrei Alexandrescu <aalexandre@fb.com>
Wed, 11 Dec 2013 15:43:27 +0000 (07:43 -0800)
committerJordan DeLong <jdelong@fb.com>
Fri, 20 Dec 2013 21:05:27 +0000 (13:05 -0800)
commit51fea2985522e8461528252a77822a9b4fa1f09f
tree99b658fe22409d9f5321b6179c465cebb74592c2
parent9b9fb1d60d65ddbdf538851494f3899474b1dd17
SCOPE_SUCCESS should be able to throw, the others shouldn't

Summary: SCOPE_SUCCESS may legitimately throw, so changed the `noexcept` attribute to a conditional one. Also added the noexcept promise to the lambdas in the hope the compiler will check code during compilation appropriately. (It currently doesn't.)

Test Plan: Added a unittest that failed, not passes.

Reviewed By: simpkins@fb.com

FB internal diff: D1093328

@override-unit-failures
folly/ScopeGuard.h
folly/test/ScopeGuardTest.cpp