4 ms·
As mentioned in the comments: "Maybe take a peek at Ada Generics. The generic instances are shared, and there is no boxing of types." RM12: https://www.adaic.o
by okl 6y ago
As mentioned in the comments: "Maybe take a peek at Ada Generics. The generic instances are shared, and there is no boxing of types."
RM12: https://www.adaic.org/resources/add_content/standards/05rm/html/RM-12.html https://www.adaic.org/resources/add_content/standards/05rm/h...
RAT83: http://archive.adaic.com/standards/83rat/html/ratl-12.html http://archive.adaic.com/standards/83rat/html/ratl-12.html
- twic 6y agoI think C# generics also work this way, at least to an extent. For example, a single instance of generic hashmap code can store any value as long as it's one word in size, which the most common sizes of integer, floating-point number, and pointer are. EDIT: as many comments on that post say, sorry!