I have some troubles with a c++ project i started. I am trying to implement basic linked list and my attempt includes proxy class in the list class for representing single node. One of the list constructors can get single parameter and initialize the first node of the list with it, but i can't pass that parameter to the proxy class' constructor. Any suggestions how to do it?
Here is some c++ code
template <class TYPE>
class list{
private:
//Proxy class for node representation
class node{
private:
node* next;
TYPE data;
public:
explicit node() : next(nullptr) {}
node (const TYPE& init) : data(init) {}
inline node*& get_next(){
return next;
}
inline TYPE& get_data(){
return data;
}
};
node* head;
unsigned int size;
public:
explicit list() : head(nullptr), size(0) {}
list(const TYPE& init) : list::node(init) {}