--- nono/lib/fixedqueue.h 2026/04/29 17:04:51 1.1.1.6 +++ nono/lib/fixedqueue.h 2026/04/29 17:05:08 1.1.1.8 @@ -4,6 +4,10 @@ // Licensed under nono-license.txt // +// +// 固定長キュー +// + #pragma once #include "header.h" @@ -17,8 +21,7 @@ // T 型で上限 capacity 個のキュー。 // スレッドセーフではない。 template -class FixedQueue - : private std::vector +class FixedQueue : private std::vector { using inherited = std::vector; public: @@ -40,7 +43,7 @@ class FixedQueue // 空きがあれば追加して true を返す。 // 空きがなければ何もせず false を返す。 - bool Enqueue(T val) { + bool Enqueue(const T& val) { if (IsFull()) { return false; } else { @@ -51,7 +54,7 @@ class FixedQueue } // 空きがなければ古いのを捨てて追加する。 - void EnqueueForce(T val) { + void EnqueueForce(const T& val) { if (IsFull()) { Dequeue(); }