Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
一个类有一个队列,我需要在类的构造函数中设置队列大小。这可能吗?
只是一个想法,我想做什么:
class Test { queue<int> age_queue; Test(int queue_size):age_queue(queue_size){} };
尝试
class Test { queue<int> age_queue; Test(int queue_size):age_queue(deque<int>(queue_size)){} };