Composing features at compile time

Dicebot public at dicebot.lv
Sun Nov 24 11:52:44 PST 2013


On Sunday, 24 November 2013 at 19:37:44 UTC, Jacob Carlborg wrote:
> So StubLogger would implement "info" but do nothing? How good 
> would the compiler be at optimizing this?

Last time I checked such stuff LDC is quite capable at 
eliminating it completely. It works somewhat better for 
state-less stuff though as you still get extra pointer overhead 
because of instantiated field. If you could call static methods 
instead, only overhead will be of few extra unused symbols in 
binary.


More information about the Digitalmars-d-learn mailing list