class error_code;
class error_condition;
- class error_category;
class system_error;
/// is_error_code_enum
struct is_error_condition_enum<errc>
: public true_type { };
+ inline namespace _V2 {
/// error_category
class error_category
{
public:
-#ifdef _GLIBCXX_COMPATIBILITY_CXX0X
- error_category() noexcept;
-#else
constexpr error_category() noexcept = default;
-#endif
virtual ~error_category();
virtual const char*
name() const noexcept = 0;
+ // We need two different virtual functions here, one returning a
+ // COW string and one returning an SSO string. Their positions in the
+ // vtable must be consistent for dynamic dispatch to work, but which one
+ // the name "message()" finds depends on which ABI the caller is using.
+#if _GLIBCXX_USE_CXX11_ABI
+ private:
+ _GLIBCXX_DEFAULT_ABI_TAG
+ virtual __cow_string
+ _M_message(int) const;
+
+ public:
+ _GLIBCXX_DEFAULT_ABI_TAG
+ virtual string
+ message(int) const = 0;
+#else
virtual string
message(int) const = 0;
+ private:
+ virtual __sso_string
+ _M_message(int) const;
+#endif
+
+ public:
virtual error_condition
default_error_condition(int __i) const noexcept;
_GLIBCXX_CONST const error_category& system_category() noexcept;
_GLIBCXX_CONST const error_category& generic_category() noexcept;
+ } // end inline namespace
+
error_code make_error_code(errc) noexcept;
template<typename _Tp>
error_condition
default_error_condition() const noexcept;
+ _GLIBCXX_DEFAULT_ABI_TAG
string
message() const
{ return category().message(value()); }
const error_category&
category() const noexcept { return *_M_cat; }
+ _GLIBCXX_DEFAULT_ABI_TAG
string
message() const
{ return category().message(value()); }