In C++, the templates can not be generated into dynamic libraries, we can only use them by header files.
In C#, generic functions and types can be interpreted by interme
An rlib
is a regular static library (built in the ar
format) that contains additional metadata. That metadata contains, among other things, the complete, serialised abstract syntax tree (AST) for all generics and functions marked with #[inline]
.
It's a bit like if there was a C++ compiler that shoved a library's header files into the compiled binary, and then read them out again when linking against that library.