is there a common type?

Jonathan M Davis jmdavisProg at gmx.com
Tue May 15 11:56:55 PDT 2012


On Tuesday, May 15, 2012 11:14:51 Ali Çehreli wrote:
> On 05/15/2012 10:29 AM, Christian Köstlin wrote:
> > for [1, 2, 3] and iota(2, 10)?
> > 
> > thanks in advance
> > 
> > christian
> 
> When it comes to compile-time polymorphism or duck typing, they are both
> RandomAccessRanges. (Pedantically, [1, 2, 3] is not a range (I think
> :P), but a container. Although, any slice of it is a RandomAccessRange.)

Actually, if you're being _really_ pedantic, it _isn't_ a container, because 
it doesn't own its own memory. The runtime does. The array is a slice/range of 
elements that the runtime holds.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list