sync PR 162 and PR 163 to v4

This commit is contained in:
zhangyiru
2021-10-15 10:31:34 -04:00
parent 75600e3519
commit 13ba033116
3 changed files with 12 additions and 3 deletions

View File

@ -88,7 +88,8 @@ typedef regex_error bad_expression;
namespace BOOST_REGEX_DETAIL_NS{
inline void BOOST_REGEX_CALL raise_runtime_error(const std::runtime_error& ex)
template <class E>
inline void raise_runtime_error(const E& ex)
{
#ifndef BOOST_REGEX_STANDALONE
::boost::throw_exception(ex);
@ -101,7 +102,7 @@ template <class traits>
void raise_error(const traits& t, regex_constants::error_type code)
{
(void)t; // warning suppression
std::runtime_error e(t.error_string(code));
regex_error e(t.error_string(code), code, 0);
::boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(e);
}