On Friday, 17 January 2014 at 09:19:12 UTC, Kagamin wrote:
On Thursday, 16 January 2014 at 15:55:07 UTC, Steven
Schveighoffer wrote:
I am thinking of this layout for streams/buffers:
1. Unbuffered stream used for raw i/o, based on a class
hierarchy (which I have pretty much written)
2. Buffer like you have, based on a struct, with specific
primitives. It's job is to collect data from the underlying
stream, and present it to consumers as a random-access buffer.
If you have a struct-based buffer, how would you enlarge the
buffer? Won't it suffer from AA syndrome?
It is the lazily initialized nature of AAs that causes the
problem. Structs can, but don't have to, replicate the behaviour.