xref: /third_party/gn/src/base/containers/stack.h (revision 6d528ed9)
1// Copyright 2017 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef BASE_CONTAINERS_STACK_H_
6#define BASE_CONTAINERS_STACK_H_
7
8#include <stack>
9
10#include "base/containers/circular_deque.h"
11
12namespace base {
13
14// Provides a definition of base::stack that's like std::stack but uses a
15// base::circular_queue instead of std::deque. Since std::stack is just a
16// wrapper for an underlying type, we can just provide a typedef for it that
17// defaults to the base circular_deque.
18template <class T, class Container = circular_deque<T>>
19using stack = std::stack<T, Container>;
20
21}  // namespace base
22
23#endif  // BASE_CONTAINERS_STACK_H_
24