| Avi Drissman | e4622aa | 2022-09-08 20:36:06 | [diff] [blame] | 1 | // Copyright 2017 The Chromium Authors |
| Brett Wilson | 1f07f20e | 2017-10-02 18:55:28 | [diff] [blame] | 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 | |
| 12 | namespace base { |
| 13 | |
| 14 | // Provides a definition of base::stack that's like std::stack but uses a |
| Bence Béky | a9838e0 | 2018-05-29 15:23:59 | [diff] [blame] | 15 | // base::circular_deque instead of std::deque. Since std::stack is just a |
| Brett Wilson | 1f07f20e | 2017-10-02 18:55:28 | [diff] [blame] | 16 | // wrapper for an underlying type, we can just provide a typedef for it that |
| 17 | // defaults to the base circular_deque. |
| 18 | template <class T, class Container = circular_deque<T>> |
| 19 | using stack = std::stack<T, Container>; |
| 20 | |
| 21 | } // namespace base |
| 22 | |
| 23 | #endif // BASE_CONTAINERS_STACK_H_ |