Define result in boost::system instead of in boost::result

This commit is contained in:
Peter Dimov
2021-09-16 18:56:35 +03:00
parent fd852c675e
commit ae77563039
12 changed files with 33 additions and 29 deletions

View File

@ -1,5 +1,5 @@
#ifndef BOOST_RESULT_RESULT_HPP_INCLUDED
#define BOOST_RESULT_RESULT_HPP_INCLUDED
#ifndef BOOST_SYSTEM_RESULT_HPP_INCLUDED
#define BOOST_SYSTEM_RESULT_HPP_INCLUDED
// Copyright 2017, 2021 Peter Dimov.
// Distributed under the Boost Software License, Version 1.0.
@ -18,16 +18,20 @@
namespace boost
{
namespace result
namespace system
{
class error_code;
// throw_exception_from_error_code
BOOST_NORETURN void throw_exception_from_error_code( std::error_code const & e )
BOOST_NORETURN inline void throw_exception_from_error_code( std::error_code const & e )
{
boost::throw_exception( std::system_error( e ) );
}
BOOST_NORETURN inline void throw_exception_from_error_code( error_code const & e );
// in_place_*
using in_place_value_t = variant2::in_place_index_t<0>;
@ -38,7 +42,7 @@ constexpr in_place_error_t in_place_error{};
// result
template<class T, class E = std::error_code> class result
template<class T, class E = error_code> class result
{
private:
@ -335,7 +339,7 @@ template<class Ch, class Tr, class T, class E> std::basic_ostream<Ch, Tr>& opera
return os;
}
} // namespace result
} // namespace system
} // namespace boost
#endif // #ifndef BOOST_RESULT_RESULT_HPP_INCLUDED
#endif // #ifndef BOOST_SYSTEM_RESULT_HPP_INCLUDED

View File

@ -2,14 +2,14 @@
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/result/result.hpp>
#include <boost/system/result.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/core/lightweight_test_trait.hpp>
#include <system_error>
#include <iosfwd>
#include <cerrno>
using namespace boost::result;
using namespace boost::system;
struct X
{

View File

@ -2,11 +2,11 @@
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/result/result.hpp>
#include <boost/system/result.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/core/lightweight_test_trait.hpp>
using namespace boost::result;
using namespace boost::system;
struct X
{

View File

@ -2,11 +2,11 @@
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/result/result.hpp>
#include <boost/system/result.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/core/lightweight_test_trait.hpp>
using namespace boost::result;
using namespace boost::system;
struct X
{

View File

@ -2,13 +2,13 @@
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/result/result.hpp>
#include <boost/system/result.hpp>
#include <boost/core/lightweight_test.hpp>
#include <system_error>
#include <iosfwd>
#include <cerrno>
using namespace boost::result;
using namespace boost::system;
struct X
{

View File

@ -2,12 +2,12 @@
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/result/result.hpp>
#include <boost/system/result.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/core/lightweight_test_trait.hpp>
#include <string>
using namespace boost::result;
using namespace boost::system;
struct X
{

View File

@ -2,14 +2,14 @@
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/result/result.hpp>
#include <boost/system/result.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/core/lightweight_test_trait.hpp>
#include <system_error>
#include <string>
#include <cerrno>
using namespace boost::result;
using namespace boost::system;
struct X
{

View File

@ -2,14 +2,14 @@
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/result/result.hpp>
#include <boost/system/result.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/core/lightweight_test_trait.hpp>
#include <system_error>
#include <iosfwd>
#include <cerrno>
using namespace boost::result;
using namespace boost::system;
struct X
{

View File

@ -2,11 +2,11 @@
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/result/result.hpp>
#include <boost/system/result.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/core/lightweight_test_trait.hpp>
using namespace boost::result;
using namespace boost::system;
struct X
{

View File

@ -2,13 +2,13 @@
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/result/result.hpp>
#include <boost/system/result.hpp>
#include <boost/core/lightweight_test.hpp>
#include <system_error>
#include <iosfwd>
#include <cerrno>
using namespace boost::result;
using namespace boost::system;
struct X
{

View File

@ -2,11 +2,11 @@
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/result/result.hpp>
#include <boost/system/result.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/core/lightweight_test_trait.hpp>
using namespace boost::result;
using namespace boost::system;
struct X
{

View File

@ -2,11 +2,11 @@
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/result/result.hpp>
#include <boost/system/result.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/core/lightweight_test_trait.hpp>
using namespace boost::result;
using namespace boost::system;
struct X
{