June 06, 2011
Andrej Mitrovic wrote:
>> On 6/6/11, Jonathan M Davis <jmdavisProg@gmx.com> wrote:
>> So, anything you do on your own could be polymorphic, but as soon as you
>> get ranges from Phobos, you lose the polymorphism.
>
> Yeah, I've noticed that. I wouldn't want to loose the ability to call into std.algorithm/std.range or even Philippe's dranges library, which looks really neat. I guess I can use take() on a range and then array() to get the underlying type which I could easily pass to other functions. I'll see what I can come up with as I experiment with these features.

I don't get what the issue is. Static polymorphism can be turned into dynamic polymorphism very easily. Just write a polymorphic wrapper template for ranges. This will work with Phobos ranges just as well as with your own. ;)

Timon
1 2
Next ›   Last »