Skip to content

Commit 5cea391

Browse files
Quuxplusonemartinmoene
authored andcommitted
Replace deprecated .value() usage within expected's own code
Clang complains: warning: 'value' is deprecated: replace value() with error() [-Wdeprecated-declarations] 2333 | using ContainedEx = typename std::remove_reference< decltype( get_unexpected().value() ) >::type; | ^
1 parent be39f9a commit 5cea391

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/nonstd/expected.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2330,7 +2330,7 @@ class expected
23302330
template< typename Ex >
23312331
bool has_exception() const
23322332
{
2333-
using ContainedEx = typename std::remove_reference< decltype( get_unexpected().value() ) >::type;
2333+
using ContainedEx = typename std::remove_reference< decltype( get_unexpected().error() ) >::type;
23342334
return ! has_value() && std::is_base_of< Ex, ContainedEx>::value;
23352335
}
23362336

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

0 commit comments

Comments
 (0)