const char* GetContent() const
{
return content;
}
friend ostream & operator <<(ostream & os, const Name & n);
// Redefinition of the operator <<
ostream & operator<<(ostream& os, const Name& n)
{
os << n.GetContent();
return os;
Quote:
}
Note "const" added in strategic places.
--
With best wishes,
Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
Quote:
> during the compilation I obtain the following
> error:c:\program files\microsoft visual studio\vc98
> \include\iterator(203) : error C2679: binary '<<' : no
> operator defined which takes a right-hand operand of
> type 'const class Name' (or there is no acceptable
> conversion)
> c:\program files\microsoft visual studio\vc98
> \include\iterator(203) : while compiling class-template
> member function 'class std::ostream_iterator<class
> Name,char,struct std::char_traits<char> > &__thiscall
> std::ostream_iterator<class Name,ch
> ar,struct std::char_traits<char> >::operator =(const class
> Name &)'
> and i would like to now how to solve it
> thanks