#include <list>
#ifndef TRINODE_H
#define TRINODE_H
template <class myType>
class trinode
{
public:
//CONSTRUCTOR//
trinode(myType init_data =0);
//Creates a trinode containing specified data_field or default 0
//MEMBER FUNCTIONS//
void set_data(myType new_data);
//sets the data_field in the root
void insert_node(const myType&entry);
//Member Function to insert a new node in any direction
void remove_head(std::string direction);
//Member functions to remove a node from the begin of list
void remove_tail(std::string direction);
//Member functions to remove a node from the end of list
//CONSTANT MEMBER FUNCTIONS//
int data() const;
//const member functions to retrieve current data:
//Member functions to retrieve links:
const std::list<myType>* left() const;
std::list<myType>* left();
const std::list<myType>* right() const;
std::list<myType>* right();
const std::list<myType>* down() const;
std::list<myType>* down();
private:
myType data_field;
std::list<myType>* left_link;
std::list<myType>* right_link;
std::list<myType>* down_link;
};
#include "trinode.cpp"
#endif
I dont want to post the entire implementation and take up a ton of space since most of the errors are probably repeating, but heres what the beginning of it looks like:
change your trinode.cpp file to some other name like trinode.inl
(and obvioulsy change the line in the trinode.h file to say #include "trinode.inl" instead of #include "trinode.cpp")