In idiomatic Rust code, it's frequent to have a dozens of monomorphization of types which layouts are very much like max(T, E).
Template types allows to set methods once, but still requires manual declaration of instantiations.
What if we could:
- declare
#layout_conservative_like(T1, T2, …, TN) on a template type to define a generic layout
- not have to manually declare instantiations anymore
Let zngur encounter an uninstantiated type for which a template type exist with a generic layout and instantiate on the fly.
This wouldn't solve all boilerplate cases but this would probably pave the way to reduce it.
WDYT?
In idiomatic Rust code, it's frequent to have a dozens of monomorphization of types which layouts are very much like max(T, E).
Template types allows to set methods once, but still requires manual declaration of instantiations.
What if we could:
#layout_conservative_like(T1, T2, …, TN)on a template type to define a generic layoutLet zngur encounter an uninstantiated type for which a template type exist with a generic layout and instantiate on the fly.
This wouldn't solve all boilerplate cases but this would probably pave the way to reduce it.
WDYT?