proxygen
ThrowInDestructor< N, I > Struct Template Reference

Public Types

using InnerThrowInDestructor = ThrowInDestructor< N, I-1 >
 

Public Member Functions

 ThrowInDestructor ()
 
 ~ThrowInDestructor ()
 

Detailed Description

template<size_t N, size_t I = N>
struct ThrowInDestructor< N, I >

Definition at line 105 of file UncaughtExceptionsTest.cpp.

Member Typedef Documentation

template<size_t N, size_t I = N>
using ThrowInDestructor< N, I >::InnerThrowInDestructor = ThrowInDestructor<N, I - 1>

Definition at line 106 of file UncaughtExceptionsTest.cpp.

Constructor & Destructor Documentation

template<size_t N, size_t I = N>
ThrowInDestructor< N, I >::ThrowInDestructor ( )
inline

Definition at line 107 of file UncaughtExceptionsTest.cpp.

107 {}
template<size_t N, size_t I = N>
ThrowInDestructor< N, I >::~ThrowInDestructor ( )
inline

Definition at line 109 of file UncaughtExceptionsTest.cpp.

References EXPECT_EQ, and folly::uncaught_exceptions().

109  {
110  try {
111  InnerThrowInDestructor stackObjectThrowingOnUnwind;
112  (void)stackObjectThrowingOnUnwind;
113  Validator validator(
114  N - I + 1, "validating in " + folly::to<std::string>(I));
115  LOG(INFO) << "throwing in ~ThrowInDestructor " << I;
116  throw std::logic_error("inner");
117  } catch (const std::logic_error& e) {
118  LOG(INFO) << "catching in ~ThrowInDestructor " << I << " expecting "
119  << N - I << ", it is " << folly::uncaught_exceptions();
121  }
122  }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
int uncaught_exceptions() noexcept
ThrowInDestructor< N, I-1 > InnerThrowInDestructor

The documentation for this struct was generated from the following file: