mirror of
https://github.com/boostorg/system.git
synced 2025-07-29 20:17:13 +02:00
Convert generic_category to std::generic_category
This commit is contained in:
@ -102,18 +102,17 @@ inline char const * error_category::message( int ev, char * buffer, std::size_t
|
||||
|
||||
inline boost::system::error_category::operator std::error_category const & () const
|
||||
{
|
||||
if( id_ == boost::system::detail::generic_category_id )
|
||||
{
|
||||
return std::generic_category();
|
||||
}
|
||||
|
||||
if( id_ == boost::system::detail::system_category_id )
|
||||
{
|
||||
static const boost::system::detail::std_category system_instance( this, 0x1F4D7 );
|
||||
return system_instance;
|
||||
}
|
||||
|
||||
if( id_ == boost::system::detail::generic_category_id )
|
||||
{
|
||||
static const boost::system::detail::std_category generic_instance( this, 0x1F4D3 );
|
||||
return generic_instance;
|
||||
}
|
||||
|
||||
boost::system::detail::std_category* p = ps_.load( std::memory_order_acquire );
|
||||
|
||||
if( p != 0 )
|
||||
|
@ -44,7 +44,8 @@ static void test_generic_category()
|
||||
|
||||
int ev = ENOENT;
|
||||
|
||||
BOOST_TEST_EQ( bt.message( ev ), st.message( ev ) );
|
||||
// Under MSVC, it's "no such file or directory" instead of "No such file or directory"
|
||||
BOOST_TEST_EQ( bt.message( ev ).substr( 1 ), st.message( ev ).substr( 1 ) );
|
||||
|
||||
{
|
||||
boost::system::error_code bc( ev, bt );
|
||||
|
Reference in New Issue
Block a user