foreach over pointer to range

Artur Skawina art.08.09 at gmail.com
Tue Jun 5 12:32:08 PDT 2012


On 06/05/12 21:25, Peter Alexander wrote:
> On Tuesday, 5 June 2012 at 18:46:51 UTC, Timon Gehr wrote:
>> On 06/05/2012 08:42 PM, Artur Skawina wrote:
>>> "foreach (e; pointer_to_range)" currently fails with:
>>>
>>>    Error: foreach: Range* is not an aggregate type
>>>
>>> It can be worked around with...
> 
> Why not: foreach(e; *pointer_to_range)
> 
> Seems like the obvious solution to me, and works.

Works by copying the whole range struct, which is what I don't
want to happen. And no, using a class is not an option. :)

artur


More information about the Digitalmars-d mailing list