-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: change typeid check to dynamic_cast #1409
fix: change typeid check to dynamic_cast #1409
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1409 +/- ##
=======================================
Coverage 47.79% 47.79%
=======================================
Files 380 380
Lines 20173 20173
Branches 9387 9387
=======================================
Hits 9641 9641
Misses 4083 4083
Partials 6449 6449 📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
Just a question out of curiosity: Is there a reason why the |
This was written back on C++14 (not by me 😄) so that's why. I think switching to |
I wonder if this is due to const or using base classes. but std::any would result in the same problem because it will not do any fancy casting right? |
Hmm as far as I know std::any is completely typesafe... Or what do you mean by fancy casting? |
This PR changes the way we check for compatibility in the `WhiteBoard` as sometimes the typeid check would fail, even if the cast would work. The reason for the failure is not fully understood, but a `dynamic_cast` is ok in this case, as this is not a time-critical operation. (cherry picked from commit fdc6075)
…19.x] (#1413) Backport fdc6075 from #1409. --- This PR changes the way we check for compatibility in the `WhiteBoard` as sometimes the typeid check would fail, even if the cast would work. The reason for the failure is not fully understood, but a `dynamic_cast` is ok in this case, as this is not a time-critical operation.
This PR changes the way we check for compatibility in the
WhiteBoard
as sometimes the typeid check would fail, even if the cast would work.The reason for the failure is not fully understood, but a
dynamic_cast
is ok in this case, as this is not a time-critical operation.