bug-commoncpp
[Top][All Lists]
Advanced

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

tcpstream multiple inheritance bug


From: Andrew Cheyne
Subject: tcpstream multiple inheritance bug
Date: Mon, 3 Mar 2003 13:27:25 -0500

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
 
 

reply via email to

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