2 ms·
It's not about boxing itself, but about using dynamic dispatch that is enabled by boxing. 1. Type erasure — compiler works with a single abstract interface rat
by pornel 5y ago
It's not about boxing itself, but about using dynamic dispatch that is enabled by boxing.
1. Type erasure — compiler works with a single abstract interface rather than big complex concrete types.
2. Replaces monomorphisation (a fancy word for big copy'n'paste of code for every type it's used with) with dynamic dispatch that has a single implementation for all users.