alias this + std.array.popFront
Tobias Pankrath
tobias at pankrath.net
Fri Mar 29 15:22:36 PDT 2013
On Friday, 29 March 2013 at 22:13:31 UTC, Tobias Pankrath wrote:
> Hello,
>
> the following struct is not an input range because you can't
> call popFront on it, however I'd say you should be able to.
>
> struct Wrapper {
> int[] _data;
> alias _data this;
> }
>
> Bug or intended behaviour?
>
> Thank you!
The reason seems to be that, while is(DynamicArrayTypeOf!Wrapper
== int[]) holds, isDynamicArray!Wrapper equals false, because
isDynamicArray checks for !isAggregateType!Wrapper. Looks like a
bug isDynamicArray to me.
More information about the Digitalmars-d-learn
mailing list