How to implement immutable ring buffer?

Daniel Kozák via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed May 27 04:10:35 PDT 2015


On Wed, 27 May 2015 09:20:52 +0000
drug via Digitalmars-d-learn <digitalmars-d-learn at puremagic.com> wrote:

> Could somebody share his thoughts on the subject?
> Would it be efficient? Is it possible to avoid memory copying to
> provide immutability? To avoid cache missing ring buffer should be
> like array, not list, so it's possible that the whole buffer should
> be moved. Is it neccessary to be real immutable, may be some form of
> fake immutabitiy is enough?
> I'd like to try immutability in my app, and ring buffer is what I
> don't know how to use in the realm of immutability.
> 
> Thanks

Maybe http://dlang.org/phobos/std_typecons.html#.Rebindable could help
you.


More information about the Digitalmars-d-learn mailing list