A
Al-Burak
somewhere in MyClass
....
std::streampos pos;
long long Id;
char* Key;
......
std::istream& jme:perator>>( std::istream& is, jme::MyClass& obj ) {
is >> obj.Id;
is.ignore(1);
is >> obj.Key;
is.ignore(1);
is >> static_cast<double>(obj.pos); // << Error
return is;
}
When I try 'is >> obj.pos', the compiler complains saying that it is an
umbiguous overload for operator>>, but if I try to 'type cast' the
value to double, the compiler complains saying:
file.cpp: In function `std::istream& jme:perator>>(std::istream&,
jme::MyClass&)':
file.cpp:34: error: no match for 'operator>>' in 'is >> #`float_expr'
not supported by dump_expr#<expression error>'
What am I doing wrong?
What can I do to get my program to work?
TIA
....
std::streampos pos;
long long Id;
char* Key;
......
std::istream& jme:perator>>( std::istream& is, jme::MyClass& obj ) {
is >> obj.Id;
is.ignore(1);
is >> obj.Key;
is.ignore(1);
is >> static_cast<double>(obj.pos); // << Error
return is;
}
When I try 'is >> obj.pos', the compiler complains saying that it is an
umbiguous overload for operator>>, but if I try to 'type cast' the
value to double, the compiler complains saying:
file.cpp: In function `std::istream& jme:perator>>(std::istream&,
jme::MyClass&)':
file.cpp:34: error: no match for 'operator>>' in 'is >> #`float_expr'
not supported by dump_expr#<expression error>'
What am I doing wrong?
What can I do to get my program to work?
TIA