1 // boost/cstdlib.hpp header ------------------------------------------------//
3 // (C) Copyright Beman Dawes 2001. Permission to copy, use, modify, sell
4 // and distribute this software is granted provided this copyright notice
5 // appears in all copies. This software is provided "as is" without express or
6 // implied warranty, and with no claim as to its suitability for any purpose.
8 // See http://www.boost.org/libs/utility/cstdlib.html for documentation.
11 // 26 Feb 01 Initial version (Beman Dawes)
13 #ifndef BOOST_CSTDLIB_HPP
14 #define BOOST_CSTDLIB_HPP
20 // The intent is to propose the following for addition to namespace std
21 // in the C++ Standard Library, and to then deprecate EXIT_SUCCESS and
22 // EXIT_FAILURE. As an implementation detail, this header defines the
23 // new constants in terms of EXIT_SUCCESS and EXIT_FAILURE. In a new
24 // standard, the constants would be implementation-defined, although it
25 // might be worthwhile to "suggest" (which a standard is allowed to do)
26 // values of 0 and 1 respectively.
28 // Rationale for having multiple failure values: some environments may
29 // wish to distinguish between different classes of errors.
30 // Rationale for choice of values: programs often use values < 100 for
31 // their own error reporting. Values > 255 are sometimes reserved for
32 // system detected errors. 200/201 were suggested to minimize conflict.
34 const int exit_success = EXIT_SUCCESS; // implementation-defined value
35 const int exit_failure = EXIT_FAILURE; // implementation-defined value
36 const int exit_exception_failure = 200; // otherwise uncaught exception
37 const int exit_test_failure = 201; // report_error or
38 // report_critical_error called.