// -*- C++ -*-
-// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010
-// Free Software Foundation, Inc.
+// Copyright (C) 2005-2014 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms
namespace __gnu_pbds
{
- // Base class for exceptions.
+ /**
+ * @defgroup exceptions-pbds Exceptions
+ * @ingroup pbds
+ * @{
+ */
+
+ /// Base class for exceptions.
struct container_error : public std::logic_error
{
- container_error()
+ container_error()
: std::logic_error(__N("__gnu_pbds::container_error")) { }
};
- // An entry cannot be inserted into a container object for logical
- // reasons (not, e.g., if memory is unabvailable, in which case
- // the allocator_type's exception will be thrown).
+ /// An entry cannot be inserted into a container object for logical
+ /// reasons (not, e.g., if memory is unabvailable, in which case
+ /// the allocator_type's exception will be thrown).
struct insert_error : public container_error { };
- // A join cannot be performed logical reasons (i.e., the ranges of
- // the two container objects being joined overlaps.
+ /// A join cannot be performed logical reasons (i.e., the ranges of
+ /// the two container objects being joined overlaps.
struct join_error : public container_error { };
- // A container cannot be resized.
+ /// A container cannot be resized.
struct resize_error : public container_error { };
-#if __EXCEPTIONS
inline void
- __throw_container_error(void)
- { throw container_error(); }
+ __throw_container_error()
+ { _GLIBCXX_THROW_OR_ABORT(container_error()); }
inline void
- __throw_insert_error(void)
- { throw insert_error(); }
+ __throw_insert_error()
+ { _GLIBCXX_THROW_OR_ABORT(insert_error()); }
inline void
- __throw_join_error(void)
- { throw join_error(); }
+ __throw_join_error()
+ { _GLIBCXX_THROW_OR_ABORT(join_error()); }
inline void
- __throw_resize_error(void)
- { throw resize_error(); }
-#else
- inline void
- __throw_container_error(void)
- { std::abort(); }
-
- inline void
- __throw_insert_error(void)
- { std::abort(); }
-
- inline void
- __throw_join_error(void)
- { std::abort(); }
-
- inline void
- __throw_resize_error(void)
- { std::abort(); }
-#endif
+ __throw_resize_error()
+ { _GLIBCXX_THROW_OR_ABORT(resize_error()); }
+ //@}
} // namespace __gnu_pbds
#endif