lsst.pex.exceptions g786e29fd12+c90741701a
Loading...
Searching...
No Matches
asserts.h File Reference
#include "boost/format.hpp"
#include "lsst/pex/exceptions/Exception.h"

Go to the source code of this file.

Macros

#define LSST_THROW_IF_NE(N1, N2, EXC_CLASS, MSG)
 Check whether the given values are equal, and throw an LSST Exception if they are not.
 

Macro Definition Documentation

◆ LSST_THROW_IF_NE

#define LSST_THROW_IF_NE ( N1,
N2,
EXC_CLASS,
MSG )
Value:
if ((N1) != (N2)) throw LSST_EXCEPT(EXC_CLASS, (boost::format(MSG) % (N1) % (N2)).str())
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition Exception.h:48

Check whether the given values are equal, and throw an LSST Exception if they are not.

The given message must include two Boost.Format placeholders for the two numbers.

For example:

LSST_THROW_IF_NE(3, 4, LengthError, "size of foo (%d) is not equal to size of bar (%d)");

Definition at line 38 of file asserts.h.