Skip to content

Commit c9929a6

Browse files
committed
Fix check of C::value_type where C is an int
1 parent 1269838 commit c9929a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/cpp2util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ auto as( X const& x ) -> auto
880880
// Experiment: Recognize the nested `::value_type` pattern for some dynamic library types
881881
// like std::optional, and try to prevent accidental narrowing conversions even when
882882
// those types themselves don't defend against them
883-
if constexpr( requires{ typename C::value_type; } && std::is_convertible_v<X, typename C::value_type> ) {
883+
if constexpr( requires{ typename C::value_type; } && requires { std::is_convertible_v<X, typename C::value_type>; } ) {
884884
if constexpr( is_narrowing_v<typename C::value_type, X>) {
885885
return nonesuch;
886886
}

0 commit comments

Comments
 (0)