So how exactly does one make a persistent range object?

Andrej Mitrovic andrej.mitrovich at gmail.com
Sun Jun 5 17:47:45 PDT 2011


Yeah I'm referring to polymorphism.

If I want to provide some sort of interface for my users that let them
build any type of range at runtime, or even a range of ranges, then
there's polymorphism involved. Other than polymorphism there's no
other way a function can take or return a generic range type at
runtime without know its exact type at compile-time.

Of course a polymorphic range of ranges is going to be a performance
bottleneck due to virtual function calls, so it doesn't make sense for
ranges to be polymorphic in the first place.

I don't have a real use-case for these kinds of runtime-manipulated
range types yet. I'd have to build something before I could make some
kind of a case for them. So I'm really just speculating on what I
need, and I'm experimenting with what ranges have to offer. I'll see
how far I can go with the typeof() trick. :)


More information about the Digitalmars-d-learn mailing list