3 ms·
> You could do this with the factory pattern, applied to a template type. I don't know enough about C++ templates here, but you cannot in Rust. > How is that
by steveklabnik 5y ago
> You could do this with the factory pattern, applied to a template type.
I don't know enough about C++ templates here, but you cannot in Rust.
> How is that done in languages that do support this?
I don't know enough about the implementations to actually say, to be honest. Most of them aren't systems languages, and so have significantly less constraints on implementations, and less monomorphization. I imagine that helps.