bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tcpstream multiple inheritance bug


From: David Sugar
Subject: Re: tcpstream multiple inheritance bug
Date: Tue, 11 Mar 2003 18:48:25 -0500
User-agent: KMail/1.4.3

This is true, the read and write were overloaded and ambigious in this case.  
Perhaps we should use readData/writeData (to match the existing readLine) or 
something similar?

On Monday 03 March 2003 01:27 pm, Andrew Cheyne wrote:
> With the addition of the read(...) method to the Socket class (in
> socket.h), tcpstream now exposes an ambiguous method error when
> attempting to use the class directly.
>
> For example (application code):
>
> tpstream tcp;
>
> // take care of initializing..
> // ... eventually, we want to do a read of one char:
>
> tcp.read(buf, 1);
>
>     Since read() is defined in both Socket and std::istream, the
> compiler doesn't know which read() method to use, and complains (error).
>
> I was able to get around this (for now), by doing:
>
> std::iostream* tcpio = (std::iostream*)(&tcp);
> tcpio->read(buf, 1 );
>
>    which is really ugly, but works..
>
> Andrew
>
> PS: I am not subscribed to the mailing list, so email me directly if you
> need further information.
>
> Andrew Cheyne
> Senior Software Developer
> GridIron Software
> 613.226.9445 ext. 285
> address@hidden
> http://www.gridironsoftware.com <http://www.gridironsoftware.com/>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]