|
|
|
|
|
by choeger
1261 days ago
|
|
I wouldn't say that C++ templates use monomorphization, because there are no polymorphic functions to begin with. Monomorphization, as in "the standard FPL technique", comes after type checking. C++ template specialization precedes type checking. Of course one can redefine the meaning of "polymorphism" and "monomorphization" to fit C++, but then these words lose nearly all meaning. |
|
In my plebeian brain I just thought “monomorphization = static dispatch” / 0-cost abstraction (vs. just writing multiple versions of a function), which both Rust generics and C++ templates fall into.
Now I see that “monomorphization” has a specific definition in FPL