https://issues.dlang.org/show_bug.cgi?id=15413
Johannes Pfau <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #5 from Johannes Pfau <[email protected]> --- > However, considering that almost all range-based code copies ranges, I find > it hard to believe that having a non-copyable range makes much sense. All implementations of Unique however work by disabling this(this), which means you can't foreach over unique ranges. One place where this would be really idiomatic is this: I'd like to return a Range which maps d2sqlite3 result rows to the deserialized types. However, in SQLite you have to explicitly keep track of & finalize the statement which was use to generate the query. Ideally you could do just this: foreach(value; db.query!Commit(/*sha =*/ "abcd") {} and when the range goes out of scope it finalizes the statement. Because of foreachs implicit copying, you now have to use reference counting instead... --
