Add throw_exception_from_error overload for std::error_code

This commit is contained in:
Peter Dimov
2022-02-03 18:35:42 +02:00
parent 9c6a09f41d
commit a5d68e52e6
2 changed files with 40 additions and 1 deletions
+6
View File
@@ -16,6 +16,7 @@
#include <type_traits>
#include <utility>
#include <iosfwd>
#include <system_error>
//
@@ -31,6 +32,11 @@ BOOST_NORETURN BOOST_NOINLINE inline void throw_exception_from_error( error_code
boost::throw_exception( system_error( e ) );
}
BOOST_NORETURN BOOST_NOINLINE inline void throw_exception_from_error( std::error_code const & e )
{
boost::throw_exception( std::system_error( e ) );
}
// in_place_*
using in_place_value_t = variant2::in_place_index_t<0>;