Archived:Using TRAP IGNORE in a backward-compatible manner
Archived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.
Overview
S60 3rd Edition supports the TRAP_IGNORE template that catches leaves and does nothing on error. You can add TRAP_IGNORE support for older editions of the S60 platform when adding this define into a visible header:
#if !defined(EKA2)
#define TRAP_IGNORE(_s) {TInt _ignore;TTrap __t;if (__t.Trap(_ignore)==0)
{_s;TTrap::UnTrap();}}
#endif
Using this is similar to using it in the S60 3rd Edition platform environment:
TRAP_IGNORE( SomeLeavingFunctionL());
Postconditions
TRAP_IGNORE is supported.


(no comments yet)