Use virtual operators in vector.h
#1287
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In reference to: #1193
I've been thinking more about this, and considering that even in the BETA, all the arithmetic operations always and consistently use dynamic dispatch, I figured whatever it is, it must have been present in the BETA as well.
Then I randomly tried making the arithmetic operations virtual operator functions, and it turns out that for some arcane reason, MSVC 4.20 always uses dynamic dispatch for virtual functions that are operators, even if they for all intents and purposes should be inlined. Since operators in C++ are essentially just regular functions (with an extra way of calling them using the operator syntax) I did not expect that the compiler would treat them differently, but here we are.
I think this solves the mystery once and for all. It should also clean up BETA matches since the calls are now correct.