Bugfix: the verbose_diagnostic_info output used to show some error types as references

This commit is contained in:
Emil Dotchevski
2020-08-27 17:24:37 -07:00
parent 950224b6f3
commit c886cb10ee
2 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -1141,7 +1141,7 @@ namespace boost { namespace leaf {
}
template <class E>
void add(E const & e)
void add(E && e)
{
if( !diagnostic<E>::is_invisible && already_.insert(&type<E>).second )
{
@@ -1291,16 +1291,16 @@ namespace boost { namespace leaf {
{
if( slot<e_unexpected_info> * sl = tl_slot_ptr<e_unexpected_info>::p )
if( e_unexpected_info * unx = sl->has_value(err_id) )
unx->add(e);
unx->add(std::forward<E>(e));
else
sl->put(err_id, e_unexpected_info()).add(e);
sl->put(err_id, e_unexpected_info()).add(std::forward<E>(e));
}
template <class E>
BOOST_LEAF_CONSTEXPR inline void load_unexpected( int err_id, E && e ) noexcept
{
load_unexpected_count<E>(err_id);
load_unexpected_info(err_id, std::move(e));
load_unexpected_info(err_id, std::forward<E>(e));
}
#endif
+4 -4
View File
@@ -176,7 +176,7 @@ namespace boost { namespace leaf {
}
template <class E>
void add(E const & e)
void add(E && e)
{
if( !diagnostic<E>::is_invisible && already_.insert(&type<E>).second )
{
@@ -326,16 +326,16 @@ namespace boost { namespace leaf {
{
if( slot<e_unexpected_info> * sl = tl_slot_ptr<e_unexpected_info>::p )
if( e_unexpected_info * unx = sl->has_value(err_id) )
unx->add(e);
unx->add(std::forward<E>(e));
else
sl->put(err_id, e_unexpected_info()).add(e);
sl->put(err_id, e_unexpected_info()).add(std::forward<E>(e));
}
template <class E>
BOOST_LEAF_CONSTEXPR inline void load_unexpected( int err_id, E && e ) noexcept
{
load_unexpected_count<E>(err_id);
load_unexpected_info(err_id, std::move(e));
load_unexpected_info(err_id, std::forward<E>(e));
}
#endif