e6nlaq/library

This documentation is automatically generated by online-judge-tools/verification-helper

View on GitHub

:warning: include/e6nlaq/internal/queue.hpp

Required by

Code

#pragma once

// This file is a fork of AtCoder Library.

#define E6NLAQ_INTERNAL_QUEUE_HPP

#include <vector>

namespace e6nlaq {

namespace internal {

template <class T>
struct simple_queue {
    std::vector<T> payload;
    int pos = 0;
    void reserve(int n) { payload.reserve(n); }
    int size() const { return int(payload.size()) - pos; }
    bool empty() const { return pos == int(payload.size()); }
    void push(const T& t) { payload.push_back(t); }
    T& front() { return payload[pos]; }
    void clear() {
        payload.clear();
        pos = 0;
    }
    void pop() { pos++; }
};

}  // namespace internal

}  // namespace e6nlaq
#line 2 "include/e6nlaq/internal/queue.hpp"

// This file is a fork of AtCoder Library.

#define E6NLAQ_INTERNAL_QUEUE_HPP

#include <vector>

namespace e6nlaq {

namespace internal {

template <class T>
struct simple_queue {
    std::vector<T> payload;
    int pos = 0;
    void reserve(int n) { payload.reserve(n); }
    int size() const { return int(payload.size()) - pos; }
    bool empty() const { return pos == int(payload.size()); }
    void push(const T& t) { payload.push_back(t); }
    T& front() { return payload[pos]; }
    void clear() {
        payload.clear();
        pos = 0;
    }
    void pop() { pos++; }
};

}  // namespace internal

}  // namespace e6nlaq
Back to top page