3 ms·
The real problem with boxing is that you end up with two classes of types, and that there is inherent overhead to using a class rather than a primitive. For th
by mgaunard 3y ago
The real problem with boxing is that you end up with two classes of types, and that there is inherent overhead to using a class rather than a primitive.
For those reasons, I stick to C++. With modern ABIs there is no difference between a primitive of size N and a class of size N.
- moomin 3y agoIn some languages e.g. C# you can have unboxed product types. Confusingly for anyone with a C/C++ background, they’re called “Strucks”. Of course, you lose the GC when you do so but it’s nonetheless common to see in the stdlib.