I'm going to take a stab in the dark with this, as I haven't touched templates or overloading for a couple of years.
Do you have the <<
operator overloaded for your weatherstats
class?
Your error line is trying to print the value
member variable. In your ListNode
definition you say value
is of type T
(i.e. a template).
In your main()
you are creating a linkedlist with your template type as weatherstats
.
Your error also states that it cannot convert the weatherstats
type.
So the question is: Are you Overloading <<
for the weatherstats
class ?
Unfortunately, you haven't posted the code for this class, so we can't go any further than this. Edit: Code has been posted - still no evidence of overloading
(Also I think Baget makes a good point about the direction of your stream operator later on)
EDIT2: How should you call a function? Is it &classname::function
or object.function()
?