The OR_LEAVE macro is a convenient macro that allows the application developer to de-emphasize auxiliary error checking code in most cases. It is a postfix macro which implements User::LeaveIfError on an integer return type. This means that there is less focus on the error handling code and makes the code easier to read.
Motive behind using a OR_LEAVE macro is that it should not return an integer value. It is intended for use as a postfix macro at the end of a statement. If OR_LEAVE was to return an integer value, it would encourage its use in the middle of expressions negating its intended purpose which is to reduce the focus on error checking code.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.