File indexing completed on 2025-01-18 09:52:35
0001 #ifndef BOOST_SYSTEM_DETAIL_STD_CATEGORY_HPP_INCLUDED
0002 #define BOOST_SYSTEM_DETAIL_STD_CATEGORY_HPP_INCLUDED
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #include <boost/system/detail/error_category.hpp>
0014 #include <boost/config.hpp>
0015 #include <system_error>
0016
0017
0018
0019 namespace boost
0020 {
0021
0022 namespace system
0023 {
0024
0025 namespace detail
0026 {
0027
0028 template<unsigned Id> struct id_wrapper {};
0029
0030 class BOOST_SYMBOL_VISIBLE std_category: public std::error_category
0031 {
0032 private:
0033
0034 boost::system::error_category const * pc_;
0035
0036 public:
0037
0038 boost::system::error_category const & original_category() const BOOST_NOEXCEPT
0039 {
0040 return *pc_;
0041 }
0042
0043 public:
0044
0045 template<unsigned Id>
0046 explicit std_category( boost::system::error_category const * pc, id_wrapper<Id> ): pc_( pc )
0047 {
0048 #if defined(_MSC_VER) && defined(_CPPLIB_VER) && _MSC_VER >= 1900 && _MSC_VER < 2000
0049
0050
0051
0052
0053
0054 #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
0055
0056 static_assert( Id == 0, "This constructor should only be called with Id == 0 under MS STL 14.0+" );
0057
0058 #endif
0059
0060 #endif
0061 }
0062
0063 const char * name() const BOOST_NOEXCEPT BOOST_OVERRIDE
0064 {
0065 return pc_->name();
0066 }
0067
0068 std::string message( int ev ) const BOOST_OVERRIDE
0069 {
0070 return pc_->message( ev );
0071 }
0072
0073 std::error_condition default_error_condition( int ev ) const BOOST_NOEXCEPT BOOST_OVERRIDE
0074 {
0075 return pc_->default_error_condition( ev );
0076 }
0077
0078 inline bool equivalent( int code, const std::error_condition & condition ) const BOOST_NOEXCEPT BOOST_OVERRIDE;
0079 inline bool equivalent( const std::error_code & code, int condition ) const BOOST_NOEXCEPT BOOST_OVERRIDE;
0080 };
0081
0082 }
0083
0084 }
0085
0086 }
0087
0088 #endif