[Issue 12680] isIterable fails for types with disabled postblit

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Feb 11 14:47:56 PST 2016


https://issues.dlang.org/show_bug.cgi?id=12680

--- Comment #3 from Lars T. Kyllingstad <bugzilla at kyllingen.net> ---
Ah, sorry, I didn't notice the brackets.

Well, then I guess it's more a question of how you define "a foreach loop with
a single loop variable of automatically inferred type", as it is specified in
the documentation.

This does not work:

    S[10] arr;
    foreach (s; arr[]) { }

This does work, however:

    foreach (ref s; arr[]) { }

Since the documentation doesn't say anything explicitly about ref, I'm inclined
to think that isIterable works as intended.

Maybe we need an isRefIterable template too.

--


More information about the Digitalmars-d-bugs mailing list