https://issues.dlang.org/show_bug.cgi?id=14758
--- Comment #2 from Mike <[email protected]> --- (In reply to Dmitry Olshansky from comment #1) > I'd just go for structs + template mixins for inheritance. It's not like you > do any of virtual calls/typeinfo/object factory/whatever. > > mixin template Register(blah...){ } > > struct Peripheral{ > > mixin Register!(x,y,z,...); > mixin Register!(q,w,e,...); > > } > > Makes any sesne? Yes, it makes sense, but it is not my preference, and is beside the point of this issue. Furthermore, with your suggestions, you will still have a new type for each peripheral, and therefore unwanted TypeInfo bloat for each and every one of those peripherals. The compiler/linker should generate efficient code using my pattern, and I shouldn't have to compromise. Nor should I have to add stubs for runtime features that have no hope of every being used. Rust does a good job with this, and I don't see why I should have to lower my expectations for D. --
