mirror of
https://github.com/boostorg/system.git
synced 2025-07-30 04:27:14 +02:00
Add error_code::category_name helper, use it in to_string
This commit is contained in:
@ -83,6 +83,28 @@ private:
|
|||||||
// >3: pointer to source_location, failed_ in lsb
|
// >3: pointer to source_location, failed_ in lsb
|
||||||
boost::uintptr_t lc_flags_;
|
boost::uintptr_t lc_flags_;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
char const* category_name() const BOOST_NOEXCEPT
|
||||||
|
{
|
||||||
|
// return category().name();
|
||||||
|
|
||||||
|
if( lc_flags_ == 0 )
|
||||||
|
{
|
||||||
|
// must match detail::system_error_category::name()
|
||||||
|
return "system";
|
||||||
|
}
|
||||||
|
else if( lc_flags_ == 1 )
|
||||||
|
{
|
||||||
|
// must match detail::interop_error_category::name()
|
||||||
|
return "std:unknown";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return d1_.cat_->name();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// constructors:
|
// constructors:
|
||||||
@ -598,7 +620,7 @@ public:
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
std::string r = category().name();
|
std::string r = category_name();
|
||||||
detail::append_int( r, value() );
|
detail::append_int( r, value() );
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user