_stdexcept.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. * Copyright (c) 1996,1997
  3. * Silicon Graphics Computer Systems, Inc.
  4. *
  5. * Copyright (c) 1999
  6. * Boris Fomitchev
  7. *
  8. * This material is provided "as is", with absolutely no warranty expressed
  9. * or implied. Any use is at your own risk.
  10. *
  11. * Permission to use or copy this software for any purpose is hereby granted
  12. * without fee, provided the above notices are retained on all copies.
  13. * Permission to modify the code and to distribute modified code is granted,
  14. * provided the above notices are retained, and a notice that the code was
  15. * modified is included with the above copyright notice.
  16. *
  17. */
  18. #ifndef _STLP_INTERNAL_STDEXCEPT
  19. #define _STLP_INTERNAL_STDEXCEPT
  20. #ifndef _STLP_INTERNAL_STDEXCEPT_BASE
  21. # include <stl/_stdexcept_base.h>
  22. #endif
  23. #if !defined (_STLP_USE_NATIVE_STDEXCEPT) || defined (_STLP_USE_OWN_NAMESPACE)
  24. # if defined(_STLP_USE_EXCEPTIONS) || \
  25. !(defined(_MIPS_SIM) && defined(_ABIO32) && (_MIPS_SIM == _ABIO32))
  26. _STLP_BEGIN_NAMESPACE
  27. class _STLP_CLASS_DECLSPEC logic_error : public __Named_exception {
  28. public:
  29. logic_error(const string& __s) : __Named_exception(__s) {}
  30. # ifndef _STLP_USE_NO_IOSTREAMS
  31. ~logic_error() _STLP_NOTHROW_INHERENTLY;
  32. # endif
  33. };
  34. class _STLP_CLASS_DECLSPEC runtime_error : public __Named_exception {
  35. public:
  36. runtime_error(const string& __s) : __Named_exception(__s) {}
  37. # ifndef _STLP_USE_NO_IOSTREAMS
  38. ~runtime_error() _STLP_NOTHROW_INHERENTLY;
  39. # endif
  40. };
  41. class _STLP_CLASS_DECLSPEC domain_error : public logic_error {
  42. public:
  43. domain_error(const string& __arg) : logic_error(__arg) {}
  44. # ifndef _STLP_USE_NO_IOSTREAMS
  45. ~domain_error() _STLP_NOTHROW_INHERENTLY;
  46. # endif
  47. };
  48. class _STLP_CLASS_DECLSPEC invalid_argument : public logic_error {
  49. public:
  50. invalid_argument(const string& __arg) : logic_error(__arg) {}
  51. # ifndef _STLP_USE_NO_IOSTREAMS
  52. ~invalid_argument() _STLP_NOTHROW_INHERENTLY;
  53. # endif
  54. };
  55. class _STLP_CLASS_DECLSPEC length_error : public logic_error {
  56. public:
  57. length_error(const string& __arg) : logic_error(__arg) {}
  58. # ifndef _STLP_USE_NO_IOSTREAMS
  59. ~length_error() _STLP_NOTHROW_INHERENTLY;
  60. # endif
  61. };
  62. class _STLP_CLASS_DECLSPEC out_of_range : public logic_error {
  63. public:
  64. out_of_range(const string& __arg) : logic_error(__arg) {}
  65. # ifndef _STLP_USE_NO_IOSTREAMS
  66. ~out_of_range() _STLP_NOTHROW_INHERENTLY;
  67. # endif
  68. };
  69. class _STLP_CLASS_DECLSPEC range_error : public runtime_error {
  70. public:
  71. range_error(const string& __arg) : runtime_error(__arg) {}
  72. # ifndef _STLP_USE_NO_IOSTREAMS
  73. ~range_error() _STLP_NOTHROW_INHERENTLY;
  74. # endif
  75. };
  76. class _STLP_CLASS_DECLSPEC overflow_error : public runtime_error {
  77. public:
  78. overflow_error(const string& __arg) : runtime_error(__arg) {}
  79. # ifndef _STLP_USE_NO_IOSTREAMS
  80. ~overflow_error() _STLP_NOTHROW_INHERENTLY;
  81. # endif
  82. };
  83. class _STLP_CLASS_DECLSPEC underflow_error : public runtime_error {
  84. public:
  85. underflow_error(const string& __arg) : runtime_error(__arg) {}
  86. # ifndef _STLP_USE_NO_IOSTREAMS
  87. ~underflow_error() _STLP_NOTHROW_INHERENTLY;
  88. # endif
  89. };
  90. _STLP_END_NAMESPACE
  91. # endif
  92. #endif
  93. #endif /* _STLP_INTERNAL_STDEXCEPT */