I'm working on an assignment involving double-end queues (a "deque") within a template class and am a bit confused about creating the constructor. Each deque object is supposed to be of a type "D_Node", which is a class that we just finished writing (doubly-linked list nodes).
The Deque class has three member variables:
D_Node<Item> *my_front
D_Node<Item> *my_back
size_t my_size
The constructor looks like this:
1 2 3 4 5 6 7
|
template <class Item>
Deque<Item>::Deque( const Deque &source )
{
my_front = NULL;
my_rear = NULL;
my_size = source;
}
|
I'm not having much success declaring a new Deque. I've tried a few things, none of which compile. Among them:
Deque<size_t> q(10); //no significance to the 10, just a placeholder
size_t size = 10;
Deque<size_t> q(size);
I think, though, that the Deque has to consist of D_Nodes, right? So, wouldn't I do something like:
Deque<D_Node> q(something); ???
I'm not seeing the right path to get this started. I appreciate any help.
Thanks.