template<typename ...Args>
explicit UndelayedDestruction(Args&& ...args)
: TDD(std::forward<Args>(args)...) {
- this->TDD::onDestroy_ = [&, this] (bool delayed) {
- if (delayed && !this->TDD::getDestroyPending()) {
- return;
- }
- // Do nothing. This will always be invoked from the call to destroy
- // inside our destructor.
- assert(!delayed);
- // prevent unused variable warnings when asserts are compiled out.
- (void)delayed;
- };
}
/**
this->destroy();
}
+ void onDelayedDestroy(bool delayed) override {
+ if (delayed && !this->TDD::getDestroyPending()) {
+ return;
+ }
+ // Do nothing. This will always be invoked from the call to destroy
+ // inside our destructor.
+ assert(!delayed);
+ // prevent unused variable warnings when asserts are compiled out.
+ (void)delayed;
+ }
+
protected:
/**
* Override our parent's destroy() method to make it protected.