Less Code Bloat from Templates

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Fri Oct 31 13:04:52 PDT 2014


On Fri, Oct 31, 2014 at 07:47:29PM +0000, deadalnix via Digitalmars-d wrote:
> That is basically generic à la java.
> 
> I'd like to see what can be done in term of library on that front
> as I suspect that we can get quite far.

What would be more interesting IMO, is to explore ways of automating
this so that a fully-generic template can be factored out into
type-dependent parts and type-independent parts. While type erasure is
advantageous in some circumstances, they are problematic in other
circumstances. Similarly, while D's full templating system works well
where type erasure is lacking, it also suffers from template bloat.
Ideally, the best of both worlds should lie somewhere in between.


T

-- 
It is the quality rather than the quantity that matters. -- Lucius Annaeus Seneca


More information about the Digitalmars-d mailing list