Good/Bad? @disable postblit for struct InputRange

2014-09-05 Thread Nick Sabalausky via Digitalmars-d-learn
One issue with struct-based input ranges: Saving the state of an input range is not supported (by definition of input range), and yet, you can trivially and accidentally do so with a simple assignment or passing into a function. The results may or may not blow up depending on the exact

Re: Good/Bad? @disable postblit for struct InputRange

2014-09-05 Thread monarch_dodra via Digitalmars-d-learn
On Friday, 5 September 2014 at 19:55:50 UTC, Nick Sabalausky wrote: One issue with struct-based input ranges: Saving the state of an input range is not supported (by definition of input range), and yet, you can trivially and accidentally do so with a simple assignment or passing into a

Re: Good/Bad? @disable postblit for struct InputRange

2014-09-05 Thread Nick Sabalausky via Digitalmars-d-learn
On 9/5/2014 6:14 PM, monarch_dodra wrote: Ref semantics is one option, yes. Either by class, or by struct. For example, most IO ranges implemented ref-counted reference semantics. IMO, disabling postblit is overkill, as almost anything that does anything with ranges will pass them by value at