Index: lemon/error.h
===================================================================
--- lemon/error.h	(revision 1956)
+++ lemon/error.h	(revision 2150)
@@ -518,8 +518,9 @@
 
   template <>
-  inline void assert_fail<const char *>(const char *file, int line, const char *func,
-				 const char *message, 
-				 const char *assertion,
-				 bool do_abort)
+  inline void assert_fail<const char *>(const char *file, int line, 
+                                        const char *func,
+                                        const char *message, 
+                                        const char *assertion,
+                                        bool do_abort)
   {
     using namespace std;
@@ -580,6 +581,10 @@
 #undef LEMON_FIXME
 
-#ifndef LEMON_ASSERT_ABORT
-#  define LEMON_ASSERT_ABORT 1
+#ifdef LEMON_ENABLE_ASSERTS
+#  define LEMON_ASSERT_ABORT
+#endif
+
+#ifndef LEMON_ASSERT_DO_ABORT
+#  define LEMON_ASSERT_DO_ABORT 1
 #endif
 
@@ -589,35 +594,47 @@
 #  elif defined LEMON_ASSERT_FAILURE
 #    define LEMON_ASSERT_HANDLER ::lemon::assert_fail_failure
+#  elif defined LEMON_ASSERT_ABORT
+#    define LEMON_ASSERT_HANDLER ::lemon::assert_fail
 #  else
-#    define LEMON_ASSERT_HANDLER ::lemon::assert_fail
+#    define LEMON_DISABLE_ASSERTS
 #  endif
 #endif
 
-#if defined(NDEBUG) || defined(LEMON_DISABLE_ASSERTS)
-
-#  define LEMON_ASSERT(exp, msg)  (static_cast<void> (0))
-
-#else
-
-/**
- * \brief Macro for assertions with customizable message
- *
- * Macro for assertions with customizable message.
- *
- * The behaviour can be customized with LEMON_ASSERT_HANDLER,
- * LEMON_ASSERT_EXCEPTION and LEMON_ASSERT_ABORT defines. Asserts can be
- * disabled by defining either NDEBUG or LEMON_DISABLE_ASSERTS macros.
- *
- * \todo We should provide some way to reset to the default behaviour,
- * shouldn't we?
- *
- * \todo This whole 'assert' business should be placed in a separate
- * include file. The boost assert is not guarded by header sentries
- * which may help to change the behaviour of the assertions in 
- * the files.
- *
- * \todo __PRETTY_FUNCTION__ should be replaced by something
- * compiler-independent, like BOOST_CURRENT_FUNCTION
- */
+#ifdef DOXYGEN
+
+/// \brief Macro for assertions with customizable message
+///
+/// Macro for assertions with customizable message.
+///
+/// The assertions are disabled in the default behaviour. You can
+/// enable the assertions with the LEMON_ENABLE_ASSERTS macro what
+/// provides a log on the standard error about the assertion and aborts
+/// the program.  If the LEMON_ASSERT_DO_ABORT macro is setted to false
+/// then the just the log message can be seen on the standard error but
+/// the program is not stopped. With the LEMON_ASSERT_FAILURE and
+/// LEMON_ASSERT_EXCEPTION macros you can set other behaviour to the
+/// assertions. The LEMON_ASSERT_FAILURE will always throw an \c
+/// AssertionFailedError exception with the \c msg error message. The
+/// \c LEMON_ASSERT_EXCEPTION can throw a user defined exception.
+///
+/// The LEMON_ASSERT macro should be called with the \c exp parameter
+/// which should be an expression convertible to bool. If the given
+/// parameter is false the assertion is raised and one of the assertion
+/// behaviour will be activated. The \c msg should be either a const
+/// char* message or an exception. When the \c msg is an exception the
+/// \ref "Exception::what" what() function is called to retrieve and
+/// display the error message.
+///
+///
+/// \todo We should provide some way to reset to the default behaviour,
+/// shouldn't we?
+///
+/// \todo This whole 'assert' business should be placed in a separate
+/// include file. The boost assert is not guarded by header sentries
+/// which may help to change the behaviour of the assertions in 
+/// the files.
+///
+/// \todo __PRETTY_FUNCTION__ should be replaced by something
+/// compiler-independent, like BOOST_CURRENT_FUNCTION
 
 #  define LEMON_ASSERT(exp, msg)                 \
@@ -625,7 +642,19 @@
        LEMON_ASSERT_HANDLER(__FILE__, __LINE__,  \
                             __PRETTY_FUNCTION__, \
-			    msg, #exp, LEMON_ASSERT_ABORT), 0)))
-
-#endif // NDEBUG || LEMON_DISABLE_ASSERTS
+                            msg, #exp, LEMON_ASSERT_DO_ABORT), 0)))
+
+#else 
+#  if defined LEMON_DISABLE_ASSERTS
+
+#    define LEMON_ASSERT(exp, msg)  (static_cast<void> (0))
+
+#  else
+#    define LEMON_ASSERT(exp, msg)                 \
+       (static_cast<void> (!!(exp) ? 0 : (         \
+         LEMON_ASSERT_HANDLER(__FILE__, __LINE__,  \
+                              __PRETTY_FUNCTION__, \
+                              msg, #exp, LEMON_ASSERT_DO_ABORT), 0)))
+#  endif
+#endif
 
 /**
