Skip to content

Commit

Permalink
Use reinterpret_cast for Pointerlike::as<T*> to avoid issues with fun…
Browse files Browse the repository at this point in the history
…ction pointer types
  • Loading branch information
Sainan committed Dec 26, 2024
1 parent 8a6ef81 commit a9707ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion soup/Pointerlike.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ NAMESPACE_SOUP
template <typename T>
[[nodiscard]] std::enable_if_t<std::is_pointer_v<T>, T> as() const noexcept
{
return static_cast<T>(_addr());
return reinterpret_cast<T>(_addr());
}

template <typename T>
Expand Down

0 comments on commit a9707ab

Please sign in to comment.