On 06-Oct-12 12:13, monarch_dodra wrote:
On Saturday, 6 October 2012 at 08:00:42 UTC, Johannes Pfau wrote:
Am Fri, 05 Oct 2012 17:15:44 +0200
schrieb "monarch_dodra" <[email protected]>:
[SNIP]
Couldn't we just fix std.range.put to check for an 'empty' property?
Well, the issue (imo) is not put's implementation: as Steven
Schveighoffer said, cramming too big into too small is wrong (logic error).
The problem (I think), is that once a range verifies the isOutputRange
criteria, the user should be able to call "put" without (too much) worries.
Not possible. The only thing isOutputRange serves is that putting stuff
into X is sensible in one of many ways (delegates, own put, input range
with assignable elements).
Any run-time properties such as lengths and maximums are out of
isOutputRange business. And in the end one can still run out of
supposedly "infinite" things like RAM, disk space etc.
--
Dmitry Olshansky