// system.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" //#define BOOST_ALL_NO_LIB #define BOOST_SYSTEM_NO_LIB #include <boost/system/error_code.hpp> #include <boost/system/system_error.hpp> #include <libs/system/src/error_code.cpp> using namespace std; void testit() { using namespace boost::system; //std::system_category() const boost::system::error_category &syscategory = boost::system::system_category(); cout<< syscategory.name()<<endl; boost::system::error_code ec; assert(ec.value() == boost::system::errc::success); assert(!ec); assert(ec.category() == syscategory); ec.assign(3, syscategory); boost::system::error_condition econd = ec.default_error_condition(); assert(econd == syscategory.default_error_condition(3)); cout<<ec.message()<<endl; cout<<econd.message()<<endl; cout<<econd.value()<<endl; } int _tmain(int argc, _TCHAR* argv[]) { testit(); return 0; }