Hello everyone. Well, basically, what I've been doing was creating a class that would implement the concept of Double Linked List, but that would behave like a queue ( the STL implementation is deque, or Double Ended Queue ).
The problem occured when I have been trying to generalize the class using templates. I mean, why use only integers ? Why not double or char or what not ?
So, here are parts of the code, hope someone will be able to help me understand what I am doing wrong.
PS: Worked perfectly before including all the template stuff..
Template classes should have their implementation in the same file with the declaration. Also, the STLs implementation of doubly linked list is std::list.
Uhm, alright, I will check that later on. And thanks for the help :) Both of you :)
And regarding the Double Linked List.. I said I want it to behave as a queue <=> No other operations may be performed on the list apart from Push_Front, Push_Back, Pop_Front, Pop_Back, getting the front/back and printing the list.
The std::list has more operations allowed:
template < class T, class Alloc = allocator<T> > class list;
List
Lists are sequence containers that allow constant time insert and erase operations anywhere within the sequence, and iteration in both directions.
So, what I meant is really std::deque, not std::list.
template < class T, class Alloc = allocator<T> > class deque;
Double ended queue
deque (usually pronounced like "deck") is an irregular acronym of double-ended queue. Double-ended queues are sequence containers with dynamic sizes that can be expanded or contracted on both ends (either its front or its back).
But thanks again, the topic is closed.
EDIT: @ne555 I tried to remove the pointer declaration and use the normal declaration. Same issue. But I will try again. Maybe it's going to work now with what @vlad from moscow also mentioned.