Move make_ functions for errc to errc.hpp

This commit is contained in:
Peter Dimov
2020-08-27 16:15:10 +03:00
parent 96321beb88
commit ff18f28684
5 changed files with 65 additions and 27 deletions

View File

@@ -0,0 +1,25 @@
// Copyright 2020 Peter Dimov.
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/system/error_condition.hpp>
#include <boost/system/errc.hpp>
#include <boost/core/lightweight_test.hpp>
namespace sys = boost::system;
int main()
{
sys::error_condition en( sys::errc::no_such_file_or_directory );
BOOST_TEST_EQ( en.value(), ENOENT );
BOOST_TEST( en );
BOOST_TEST( !!en );
BOOST_TEST( en == make_error_condition( sys::errc::no_such_file_or_directory ) );
BOOST_TEST( en.category() == sys::error_condition().category() );
return boost::report_errors();
}