stl_range_errors.h

00001 /*
00002  * Copyright (c) 1999
00003  * Silicon Graphics
00004  *
00005  * Permission to use, copy, modify, distribute and sell this software
00006  * and its documentation for any purpose is hereby granted without fee,
00007  * provided that the above copyright notice appear in all copies and
00008  * that both that copyright notice and this permission notice appear
00009  * in supporting documentation.  Silicon Graphics makes no
00010  * representations about the suitability of this software for any
00011  * purpose.  It is provided "as is" without express or implied warranty.
00012  *
00013  */
00014 
00015 #ifndef __STL_RANGE_ERRORS_H
00016 #define __STL_RANGE_ERRORS_H
00017 
00018 // A few places in the STL throw range errors, using standard exception
00019 // classes defined in <stdexcept>.  This header file provides functions
00020 // to throw those exception objects.
00021 
00022 // __STL_DONT_THROW_RANGE_ERRORS is a hook so that users can disable
00023 // this exception throwing.
00024 
00025 #include <stl_config.h>
00026 
00027 #if defined(__STL_CAN_THROW_RANGE_ERRORS) && \
00028     defined(__STL_USE_EXCEPTIONS) && \
00029     !defined(__STL_DONT_THROW_RANGE_ERRORS)
00030 # define __STL_THROW_RANGE_ERRORS
00031 #endif
00032 
00033 // For the SGI 7.3 compiler, declare these functions here and define them
00034 // elsewhere.
00035 #if defined(__STL_THROW_RANGE_ERRORS) && \
00036     defined(__sgi) && !defined(__GNUC__) && \
00037     _COMPILER_VERSION >= 730 && defined(_STANDARD_C_PLUS_PLUS)
00038 
00039 __STL_BEGIN_NAMESPACE
00040 void __stl_throw_range_error(const char* __msg);
00041 void __stl_throw_length_error(const char* __msg);
00042 __STL_END_NAMESPACE
00043 
00044 // For other compilers where we're throwing range errors, include the
00045 // stdexcept header and throw the appropriate exceptions directly.
00046 #elif defined(__STL_THROW_RANGE_ERRORS)
00047 
00048 #include <stdexcept>
00049 
00050 __STL_BEGIN_NAMESPACE
00051 inline void __stl_throw_range_error(const char* __msg) 
00052   { throw range_error(__msg); }
00053 inline void __stl_throw_length_error(const char* __msg)
00054   { throw length_error(__msg); }
00055 __STL_END_NAMESPACE
00056 
00057 // Otherwise, define inline functions that do nothing.
00058 #else 
00059 
00060 __STL_BEGIN_NAMESPACE
00061 inline void __stl_throw_range_error(const char*) {}
00062 inline void __stl_throw_length_error(const char*) {}
00063 __STL_END_NAMESPACE
00064 
00065 #endif
00066 
00067 #endif /* __STL_RANGE_ERRORS_H */
00068 
00069 // Local Variables:
00070 // mode:C++
00071 // End:

Generated on Mon Jun 5 10:20:44 2006 for Intelligence.kdevelop by  doxygen 1.4.6