// Conditional Match (or Re-Raise) #include #include EHM_EXCEPTION(empty_exception)(); EHM_VIRTUAL_TABLE(empty_exception, empty_vt); bool should_catch = false; void throw_exception() { throw (empty_exception){&empty_vt}; } void cond_catch() { try { throw_exception(); } catch (empty_exception * exc ; should_catch) { // ... } } int main(int argc, char * argv[]) { unsigned int times = 1; if (2 < argc) { times = strtol(argv[1], 0p, 10); } for (unsigned int count = 0 ; count < times ; ++count) { try { cond_catch(); } catch (empty_exception * exc) { // ... } } }