I have a macro used around a code statement, to introduce nested exception handling:
#define TRAP_EXCEPTION(statement) \
try \
{ \
try{statement} \
catch(Engine::Exception& e) \
{ \
throw MyException(e.message()); \
} \
}
This has been working well until one case raised compiler errors. I managed to construct a minimal example:
TRAP_EXCEPTION
(
std::map<MyType, bool> Map;
)
catch(MyException& e)
{
}
This gives the following errors... how do I fix it (ideally in the macro)?
> error C2143: syntax error : missing '>' before '}'
> error C2976: 'std::map' : too few template arguments
> error C2143: syntax error : missing ';' before '}'