queue.h 734 B

1234567891011121314151617181920212223
  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. #ifndef BASE_CONTAINERS_QUEUE_H_
  5. #define BASE_CONTAINERS_QUEUE_H_
  6. #include <queue>
  7. #include "base/containers/circular_deque.h"
  8. namespace base {
  9. // Provides a definition of base::queue that's like std::queue but uses a
  10. // base::circular_deque instead of std::deque. Since std::queue is just a
  11. // wrapper for an underlying type, we can just provide a typedef for it that
  12. // defaults to the base circular_deque.
  13. template <class T, class Container = circular_deque<T>>
  14. using queue = std::queue<T, Container>;
  15. } // namespace base
  16. #endif // BASE_CONTAINERS_QUEUE_H_