Reputation: 24766
A class has a queue and I need to set the queue size in the constructor of the class. Is this possible?
Just an idea what I want to do:
class Test
{
queue<int> age_queue;
Test(int queue_size):age_queue(queue_size){}
};
Upvotes: 1
Views: 1320
Reputation: 40613
Try
class Test
{
queue<int> age_queue;
Test(int queue_size):age_queue(deque<int>(queue_size)){}
};
Upvotes: 3