From 1ab1e93edc2537072bf2c82e2fee35362442196a Mon Sep 17 00:00:00 2001 From: Liam Huang Date: Wed, 10 Oct 2018 22:16:57 +0800 Subject: [PATCH] [09_queue] const in constructor's parameter. --- c-cpp/09_queue/array_queue.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c-cpp/09_queue/array_queue.hpp b/c-cpp/09_queue/array_queue.hpp index 5704da5..6bf0892 100644 --- a/c-cpp/09_queue/array_queue.hpp +++ b/c-cpp/09_queue/array_queue.hpp @@ -15,8 +15,8 @@ class ArrayQueue { public: ArrayQueue() = delete; - ArrayQueue(size_t capacity) : capacity_(capacity) { - items_ = new T[capacity]; + ArrayQueue(const size_t capacity) : capacity_(capacity) { + items_ = new T[capacity_]; } ~ArrayQueue() { if (nullptr != items_) {