i can't fix this error 
Author Message
 i can't fix this error

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

  list_stand.cpp
1K Download


Tue, 07 Sep 2004 00:58:07 GMT  
 i can't fix this error
 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



Tue, 07 Sep 2004 02:00:47 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Compile error I can't seem to fix

2. Can't believe these aren't fixed in VS.NET

3. 'Practical Algorithms' Book Bug Fixes

4. error PRJ0003: Error spawning 'cl.exe'.

5. error C2061: syntax error : identifier 'DBPROPSET'

6. Link error: 'Internal error during ReadSymbolTable'

7. Error error C2440: '=' : cannot convert from

8. Compiler Error CS0013 -- 'Unspecified error'

9. Determining what canned preprocessor symbols are available

10. Beginner [Q] Using Canned File Open/Save dialog

11. Help with compiling a "canned" program

12. Canned Dialogs

 

 
Powered by phpBB® Forum Software