Skip to content

Commit bd218d0

Browse files
authored
Merge pull request #80 from filipsajdak/fsajdak-fix-is-pointer-dynamic-cast
[FIX] Correct casting to pointer instead of reference
2 parents c511638 + b790f6d commit bd218d0

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
@@ -539,7 +539,7 @@ auto is( X const& x ) -> bool {
539539
template< typename C, typename X >
540540
requires (std::is_base_of_v<X, C> && !std::is_same_v<C,X>)
541541
auto is( X const* x ) -> bool {
542-
return dynamic_cast<C const&>(x) != nullptr;
542+
return dynamic_cast<C const*>(x) != nullptr;
543543
}
544544

545545
template< typename C, typename X >

0 commit comments

Comments
 (0)