libhv
libhv copied to clipboard
Add const qualifier for `TcpClient::isReconnect()` method.
这个不加const会有什么影响吗?
In my use case, the following code will cause a compile error without compile flag -fpermissive .
void f(const hv::TcpClient* raw) { // or `const hv::TcpClient&`
if (raw->isReconnet()) {
...
}
// compile error: `raw` has type `const hv::TcpClient*` but member function
// `TcpCLient::isReconnect()` not marked as const.
}
Add const qualifier for this method will not intruduce any incompatibility to existed code. So it would be a good fix?