How to implement immutable ring buffer?

drug via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed May 27 04:12:55 PDT 2015


On 27.05.2015 11:04, thedeemon wrote:
> This whole idea sounds self-contradictory.
> Ring buffer is a mutable-array-based implementation of something, for
> example of a queue. You can ask about immutable implementations of a
> queue, but that would be another question, not involving a ring buffer.
>
> What do you want to do with this buffer, what do you need it for?
In general I need to have the last n instances of some objects queue. 
Now it implemented using ring buffer. Probably, you're right about 
immutable queue, it is more suitable definition here.


More information about the Digitalmars-d-learn mailing list