Macro
SEQAN_FAIL
Force abortion of program, regardless of debugging settings.
Include Headers
seqan/basic.h
Parameters
A format string. | |
An optional list of arguments. |
Remarks
Use this if something really unexpected happens inside your functions and there is no way to report this through the API. A good example would be logic errors, e.g. invalid values.
Examples
In the following example, the SEQAN_FAIL is there if a possible value is added to MyEnum but the function foo is not updated accordingly.
VALUE_ONE,
VALUE_TWO
};
bool foo(MyEnum x) {
switch (x) {
case VALUE_ONE:
// do something
return true;
case VALUE_TWO:
// do something
return true;
}
SEQAN_FAIL("Logic error. Should never reach here. x == %d.", x);
return false;
}
See Also
SeqAn - Sequence Analysis Library - www.seqan.de