Discussion:
[Openexr-user] operator <<
Dharmendra Bhojwani
2006-10-12 04:27:34 UTC
Permalink
Hi Thanks for the response...

But we get ambigous error sometime when operator doesn't know for particular type whether it should call the operator << function or not .

In this case iDataSize is a unsigned __int64 and compiler doesn't have the operator to work on this datatype and even i can't reinterpret_cast also on this because information will be lost.And even if i provide operator << for unsigned __int64 , it works fine in vc++ but not in g++ , can you please look into this problem ?

Thanks

Nick Porcino <***@lucasarts.com> wrote:
you probably have more than one conversion possible on iDataType or iDataSize to a type ostream can accept. one way around it is to coerce the variables to a particular type so the compiler becomes un-confused. Hope this helps


---------------------------------

From: openexr-user-bounces+nporcino=***@nongnu.org [mailto:openexr-user-bounces+nporcino=***@nongnu.org] On Behalf Of Dharmendra Bhojwani
Sent: Wednesday, October 11, 2006 5:23 AM
To: Linux
Subject: [Openexr-user] std::operator<<


Hi Everybody,



I have got some error in my code....



I have one function like....




void CSISHeader::Dump (std::ostream& aStream, const int aLevel) const
{
aStream << "|" << iDataType << "," << iDataSize << "|";
}



AND i am getting error while compiling with g++



error: ambiguous overload for 'operator<<' in 'std::operator<<



Can anybody please help in this ?



Thanks





---------------------------------
All-new Yahoo! Mail - Fire up a more powerful email and get things done faster.
Loading...