More on "Component Programming"

Jonathan M Davis jmdavisProg at gmx.com
Tue May 28 11:04:00 PDT 2013


On Tuesday, May 28, 2013 19:55:43 Peter Alexander wrote:
> Phobos does this a little bit in simple cases. For example,
> retro(retro(r)) returns r if I remember correctly.

Yes. Phobos tries to optimize useless templates like that, and definitely does 
it in this particular case, though I don't know if it does it everywhere that 
it should.
 
> More complicated rewrites would be trickier to implement, and may
> be impossible cross-modules (I cannot provide a rewrite for
> retro(my.module.range) without modifying Phobos).

True, though you might be able to pull off something very close with alias 
this. The type wouldn't be the same, but it would at least convert to the same 
type.

- Jonathan M Davis


More information about the Digitalmars-d mailing list