I'm trying to port some code from Windows to Macintosh using
Codewarrior9 and Carbon. For the following code:
inline istream& operator>>(istream& in, Vec3& v)
{
return in >> "[" >> v[0] >> v[1] >> v[2] >> "]";
}
I receive this error message:
Error : illegal operands 'std::basic_istream<char, std::char_traits<char>>' >> 'const char *'
Vec3.h line 216 return in >> "[" >> v[0] >> v[1] >> v[2] >> "]";
with the second '>>' highlighted
Similar inline code for ostream gives no errors:
inline ostream& operator<<(ostream& out, const Vec4& v)
{
return
out << "[" << v[0] << " " << v[1] << " " << v[2] << " " << v[3] << "]";
}
The code is part of a c++ 3d vector library. I'm not very familiar with the std stream libraries, but this looks like standard ANSI code to me, so why does Codewarrior balk on it?
Thanks for any help on this,
Terry
Codewarrior9 and Carbon. For the following code:
inline istream& operator>>(istream& in, Vec3& v)
{
return in >> "[" >> v[0] >> v[1] >> v[2] >> "]";
}
I receive this error message:
Error : illegal operands 'std::basic_istream<char, std::char_traits<char>>' >> 'const char *'
Vec3.h line 216 return in >> "[" >> v[0] >> v[1] >> v[2] >> "]";
with the second '>>' highlighted
Similar inline code for ostream gives no errors:
inline ostream& operator<<(ostream& out, const Vec4& v)
{
return
out << "[" << v[0] << " " << v[1] << " " << v[2] << " " << v[3] << "]";
}
The code is part of a c++ 3d vector library. I'm not very familiar with the std stream libraries, but this looks like standard ANSI code to me, so why does Codewarrior balk on it?
Thanks for any help on this,
Terry