Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagecpp
static void my_assertion_proc(const char* message)
{
    printf("It's OK. I caught the assertion: %s\n", message);
    // Do something else e.g. throw MyProj::FatalException(message);
}

int main(int argc, char **argv)
{
    codes_set_codes_assertion_failed_proc(&my_assertion_proc);
// Do lots of experimental stuff knowing all// All asserts will be caught

    ...

    // Now restore default behaviour
    codes_set_codes_assertion_failed_proc(NULL);

    return 0;
}


Content by Label
showLabelsfalse
max5
spacesUDOC
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("eccodes-faqs","kb-how-to-article") and type = "page" and space = "UDOC"
labelskb-how-to-article eccodes-faqs

...