So basically I have a class "Sentence" that #includes "Word".
Sentence is a linked list of words
Here's my Question
"Word + Sentence returns a new Sentence with the Word added to the beginning" so basically
Word w = "The";
Sentence s = "dog jumped high."
//the object type of w+s should be a sentence
However, I get the error,
'Sentence' does not name a type
//this is in reference to the return type of overloaded operator+ function, which is in the word class
So is there a way to flip the right hand and left hand sides of the operator+ overload so that I can put the code in the Sentence class.
I can't put the code in the Sentence class because there is a separate overload function where I need
s+w
to return a sentence with the word added to the end