template<typename ContextType>
class tvm::WithGroup< ContextType >
A group of RAII contexts managed together.
Allows dynamically emplacing multiple context objects that are all exited (in reverse order) when the group is destroyed. ContextType must declare friend class With<ContextType> and provide EnterWithScope() / ExitWithScope() methods.
WithGroup<ConstraintContext> group;
group.Emplace(&analyzer, cond1);
group.Emplace(&analyzer, cond2);
- Template Parameters
-
| ContextType | The context type with EnterWithScope/ExitWithScope. |
template<typename ContextType >
Destructor — exits all contexts in reverse order.
On normal exit: if any ExitWithScope throws, the remaining contexts are still cleaned up, then the first exception is re-thrown.
During stack unwinding: all exceptions are swallowed to avoid std::terminate.