MCPcopy Create free account
hub / github.com/atcoder/ac-library / simple_queue

Class simple_queue

atcoder/internal_queue.hpp:10–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8namespace internal {
9
10template <class T> struct simple_queue {
11 std::vector<T> payload;
12 int pos = 0;
13 void reserve(int n) { payload.reserve(n); }
14 int size() const { return int(payload.size()) - pos; }
15 bool empty() const { return pos == int(payload.size()); }
16 void push(const T& t) { payload.push_back(t); }
17 T& front() { return payload[pos]; }
18 void clear() {
19 payload.clear();
20 pos = 0;
21 }
22 void pop() { pos++; }
23};
24
25} // namespace internal
26

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected