Boost logo

Boost-Commit :

From: bdawes_at_[hidden]
Date: 2007-08-02 11:09:49


Author: bemandawes
Date: 2007-08-02 11:09:49 EDT (Thu, 02 Aug 2007)
New Revision: 38397
URL: http://svn.boost.org/trac/boost/changeset/38397

Log:
Add generic_error_code, equal, equivalent, and redefine operator== in terms of those
Text files modified:
   branches/c++0x/boost/libs/system/src/error_code.cpp | 12 ++++++++++++
   1 files changed, 12 insertions(+), 0 deletions(-)

Modified: branches/c++0x/boost/libs/system/src/error_code.cpp
==============================================================================
--- branches/c++0x/boost/libs/system/src/error_code.cpp (original)
+++ branches/c++0x/boost/libs/system/src/error_code.cpp 2007-08-02 11:09:49 EDT (Thu, 02 Aug 2007)
@@ -203,6 +203,7 @@
   public:
     const std::string & name() const;
     posix::posix_errno posix( int ev ) const;
+ error_code generic_error_code( int ev ) const;
     std::string message( int ev ) const;
   };
 
@@ -211,6 +212,7 @@
   public:
     const std::string & name() const;
     posix::posix_errno posix( int ev ) const;
+ error_code generic_error_code( int ev ) const;
     std::string message( int ev ) const;
   };
 
@@ -230,6 +232,11 @@
     return static_cast<posix_errno>(ev);
   }
 
+ error_code posix_error_category::generic_error_code( int ev ) const
+ {
+ return error_code( ev, posix_category );
+ }
+
   std::string posix_error_category::message( int ev ) const
   {
   // strerror_r is preferred because it is always thread safe,
@@ -314,6 +321,11 @@
     return boost::system::posix::no_posix_equivalent;
   }
 
+ error_code system_error_category::generic_error_code( int ev ) const
+ {
+ return error_code( posix(ev), posix_category );
+ }
+
 # if !defined( BOOST_WINDOWS_API )
 
   std::string system_error_category::message( boost::int_least32_t ev ) const


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk