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

    struct RangePtr(R) {
       R* ptr;
       alias ptr this;
       @property front()() { return ptr.front; }
    }

but this adds unnecessary overhead (unfortunately such struct is not
always treated the same as a real pointer, eg when passing it around).

Is there some reason that makes the is-aggregate check necessary, or could
it be dropped?


Thanks,

artur

It should be dropped. A pointer to range is a perfectly fine range.

Reply via email to