Skip to content

Commit

Permalink
Replace deprecated .value() usage within expected's own code
Browse files Browse the repository at this point in the history
Clang complains:

    warning: 'value' is deprecated: replace value() with error() [-Wdeprecated-declarations]
     2333 |         using ContainedEx = typename std::remove_reference< decltype( get_unexpected().value() ) >::type;
          |                                                                                        ^
  • Loading branch information
Quuxplusone authored and martinmoene committed Dec 9, 2024
1 parent be39f9a commit 5cea391
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/nonstd/expected.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2330,7 +2330,7 @@ class expected
template< typename Ex >
bool has_exception() const
{
using ContainedEx = typename std::remove_reference< decltype( get_unexpected().value() ) >::type;
using ContainedEx = typename std::remove_reference< decltype( get_unexpected().error() ) >::type;
return ! has_value() && std::is_base_of< Ex, ContainedEx>::value;
}

Expand Down Expand Up @@ -2912,7 +2912,7 @@ class expected< void, E >
template< typename Ex >
bool has_exception() const
{
using ContainedEx = typename std::remove_reference< decltype( get_unexpected().value() ) >::type;
using ContainedEx = typename std::remove_reference< decltype( get_unexpected().error() ) >::type;
return ! has_value() && std::is_base_of< Ex, ContainedEx>::value;
}

Expand Down

0 comments on commit 5cea391

Please sign in to comment.