COIN-OR::LEMON - Graph Library

Changeset 915:c2ff0a365245 in lemon for demo


Ignore:
Timestamp:
02/14/10 19:23:55 (14 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Phase:
public
Message:

ArgParser? can throw exception instead of exit(1) (#332)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • demo/arg_parser_demo.cc

    r463 r915  
    6666    .other("...");
    6767
     68  // Throw an exception when problems occurs. The default behavior is to
     69  // exit(1) on these cases, but this makes Valgrind falsely warn
     70  // about memory leaks.
     71  ap.throwOnProblems();
     72 
    6873  // Perform the parsing process
    6974  // (in case of any error it terminates the program)
    70   ap.parse();
     75  // The try {} construct is necessary only if the ap.trowOnProblems()
     76  // setting is in use.
     77  try {
     78    ap.parse();
     79  } catch (ArgParserException &) { return 1; }
    7180
    7281  // Check each option if it has been given and print its value
Note: See TracChangeset for help on using the changeset viewer.