A
Adam
Why does this compile:
if (err != Socket::errSuccess) {
switch (err) {
case Socket::errTimeout:
ConnectionIOException cio(new
string(myTCPStream->getErrorString()), ConnectionIOException::TIMEOUT);
throw cio;
default:
ConnectionIOException cio(new
string(myTCPStream->getErrorString()), ConnectionIOException::GENERAL);
throw cio;
}
}
and this not:
if (err != Socket::errSuccess) {
switch (err) {
case Socket::errTimeout:
throw ConnectionIOException (new
string(myTCPStream->getErrorString()), ConnectionIOException::TIMEOUT);
default:
throw ConnectionIOException (new
string(myTCPStream->getErrorString()), ConnectionIOException::GENERAL);
}
}
with this error:
Connection.cpp:85: error: no matching function for call to
`ConnectionIOException::ConnectionIOException(ConnectionIOException)'
.../exceptions/ConnectionIOException.h:19: note: candidates are:
ConnectionIOException::ConnectionIOException(ConnectionIOException&)
Connection.cpp:85: error: in thrown expression
Connection.cpp:88: error: no matching function for call to
`ConnectionIOException::ConnectionIOException(ConnectionIOException)'
.../exceptions/ConnectionIOException.h:19: note: candidates are:
ConnectionIOException::ConnectionIOException(ConnectionIOException&)
Connection.cpp:88: error: in thrown expression
Thanks,
Adam
if (err != Socket::errSuccess) {
switch (err) {
case Socket::errTimeout:
ConnectionIOException cio(new
string(myTCPStream->getErrorString()), ConnectionIOException::TIMEOUT);
throw cio;
default:
ConnectionIOException cio(new
string(myTCPStream->getErrorString()), ConnectionIOException::GENERAL);
throw cio;
}
}
and this not:
if (err != Socket::errSuccess) {
switch (err) {
case Socket::errTimeout:
throw ConnectionIOException (new
string(myTCPStream->getErrorString()), ConnectionIOException::TIMEOUT);
default:
throw ConnectionIOException (new
string(myTCPStream->getErrorString()), ConnectionIOException::GENERAL);
}
}
with this error:
Connection.cpp:85: error: no matching function for call to
`ConnectionIOException::ConnectionIOException(ConnectionIOException)'
.../exceptions/ConnectionIOException.h:19: note: candidates are:
ConnectionIOException::ConnectionIOException(ConnectionIOException&)
Connection.cpp:85: error: in thrown expression
Connection.cpp:88: error: no matching function for call to
`ConnectionIOException::ConnectionIOException(ConnectionIOException)'
.../exceptions/ConnectionIOException.h:19: note: candidates are:
ConnectionIOException::ConnectionIOException(ConnectionIOException&)
Connection.cpp:88: error: in thrown expression
Thanks,
Adam