Im implementing a template class
my class is tem.h my implementation is tem.template
but temp.h has include "node.h" that means that is being inherited right?
My questions:
How can I use functions from node.h into the implementation tem.template?
Based on your terminology, I think you're confusing file inclusion with OOP's inheritance. The difference is quite large. Here's an example of OOP inheritance:
1 2 3 4 5 6 7 8 9 10 11 12 13
// This is not inheritance:
#include "AFileName"
// This is inheritance:
struct base_class
{
// ...
};
struct derived_class : base_class
{
// "derived_class" has inherited from "base_class"
};
See here: http://www.cplusplus.com/doc/tutorial/inheritance/
Not missing the point, I guess I am not being specific.
I have one class
tem.h inside has #include "node.h"
Iam implementing the class tem.h which is called tem.template because
I am using template.
Now on my constructor I think that I have to use one function from the class node.h but I am not sure how to use it.
Iam confused with the #include "node.h" because on the tem.template im implementing tem.h and also im trying to use functions from node.h
// FORWARD ITERATORS to step through the nodes of a linked list
// A node_iterator of can change the underlying linked list through the
// * operator, so it may not be used with a const node. The
// node_const_iterator cannot change the underlying linked list
// through the * operator, so it may be used with a const node.
// WARNING:
// This classes use std::iterator as its base class;
// Older compilers that do not support the std::iterator class can
// delete everything after the word iterator in the second line:
sequence<Item>::sequence(const sequence<Item>& source)
{
set_data(source); // but I know that is wrong but you know im trying to set
// set_data to the source
}
I am trying to set the second constructor but im not sure how to do it.
I think that i have to use the function set_data from the class node.h
but i am not sure
I guess I going to skip that and keep going, maybe after implementing all the functions it will make more sense and I ll be able to implement the constructor
thanks