3 public struct CirBuff(T
)
6 private size_t head
= 0;
7 private size_t size
= 0;
8 public size_t
length() const { return size
; }
10 public bool opEquals(CirBuff
!T d
) @trusted
12 if (length
!= d
.length
)
14 for (size_t i
=0; i
!=size
; ++i
)
16 if (this.data
[(this.head
+i
) % this.data
.length
] !=
17 d
.data
[(d
.head
+ i
) % d
.data
.length
])
34 mixin(sync
!(Once
, "_once"));
42 template sync(T
, string U
= "this", size_t ITER
= 0)
44 static if (ITER
== __traits(derivedMembers
, T
).length
)
48 enum string mem
= __traits(derivedMembers
, T
)[ITER
];
50 "static if(! __traits(isVirtualMethod, " ~ U
~ "." ~ mem
~ ")) { }"
51 ~ sync
!(T
, U
, ITER
+1);