COIN-OR::LEMON - Graph Library

Changeset 2410:fe46b61da4e3 in lemon-0.x for lemon/error.h


Ignore:
Timestamp:
03/14/07 19:01:04 (17 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3241
Message:

dim_to_lgf

  • use the argparser class

arg_parser improvments

  • usage of assert in cc
  • const char argv

error

  • handling the string parameter
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/error.h

    r2391 r2410  
    476476
    477477  template <typename Exception>
    478   inline void assert_fail(const char *file, int line, const char *func,
    479                    Exception exception, const char *assertion = 0,
    480                    bool do_abort=true)
     478  inline void assert_fail(const char *file, int line,
     479                          const char *func,
     480                          Exception exception,
     481                          const char *assertion = 0,
     482                          bool do_abort=true)
    481483  {
    482484    using namespace std;
     
    511513  }
    512514
     515  template <>
     516  inline void assert_fail<std::string>(const char *file, int line,
     517                                       const char *func,
     518                                       std::string message,
     519                                       const char *assertion,
     520                                       bool do_abort)
     521  {
     522    assert_fail(file, line, func, message.c_str(), assertion, do_abort);
     523  }
     524
    513525  template <typename Exception>
    514526  inline void assert_fail_failure(const char *file, int line, const char *func,
     
    522534  template <>
    523535  inline void assert_fail_failure<const char *>(const char *file, int line,
    524                                         const char *func,
    525                                         const char *message,
    526                                         const char *assertion,
    527                                         bool)
     536                                                const char *func,
     537                                                const char *message,
     538                                                const char *assertion,
     539                                                bool)
    528540  {
    529541    throw AssertionFailedError(file, line, func, message, assertion);
     542  }
     543
     544  template <>
     545  inline void assert_fail_failure<std::string>(const char *file, int line,
     546                                               const char *func,
     547                                               std::string message,
     548                                               const char *assertion,
     549                                               bool)
     550  {
     551    assert_fail_failure(file, line, func, message.c_str(), assertion, true);
    530552  }
    531553
     
    546568  {
    547569    throw AssertionFailedError(file, line, func, message, assertion);
     570  }
     571
     572  template <>
     573  inline void assert_fail_exception<std::string>(const char *file, int line,
     574                                                 const char *func,
     575                                                 std::string message,
     576                                                 const char *assertion,
     577                                                 bool)
     578  {
     579    assert_fail_exception(file, line, func, message.c_str(), assertion, true);   
    548580  }
    549581
Note: See TracChangeset for help on using the changeset viewer.