Skip to content

Commit 8b3eaef

Browse files
committed
1328 Added back type comparison in case of inheritance.
1 parent 1a95ab1 commit 8b3eaef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/cpp2util.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2102,7 +2102,8 @@ constexpr auto is( X const& x ) -> bool {
21022102
if (!x.has_value()) {
21032103
return std::same_as<T, empty>;
21042104
}
2105-
return std::same_as<T, typename X::value_type>;
2105+
return std::same_as<T, typename X::value_type>
2106+
|| std::derived_from<std::remove_pointer_t<typename X::value_type>, std::remove_pointer_t<T>>;
21062107
}
21072108

21082109
// is Value

0 commit comments

Comments
 (0)