/
githubmirror
/
nbs
Обзор
Документация
Войти
/
githubmirror
/
nbs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
library/cpp/yt/small_containers/compact_queue.h
37 строк
767 B
robot-piglet
Intermediate changes
05 дек 2023, 11:33
05 дек 2023, 11:33
257fce4
Код
Авторство
О чём код?
#pragma once #include "compact_vector.h" namespace NYT { //////////////////////////////////////////////////////////////////////////////// //! A queue optimized for storing elements inline //! and with little memory overhead. See TCompactVector. template <class T, size_t N> class TCompactQueue { public: void Push(T value); T Pop(); const T& Front() const; size_t Size() const; size_t Capacity() const; bool Empty() const; private: TCompactVector<T, N> Queue_ = TCompactVector<T, N>(N); size_t FrontIndex_ = 0; size_t Size_ = 0; }; //////////////////////////////////////////////////////////////////////////////// } // namespace NYT #define COMPACT_QUEUE_INL_H_ #include "compact_queue-inl.h" #undef COMPACT_QUEUE_INL_H_