You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's misleading (and inconsistent with the constructor version of the same API) to accept this parameter by non-const reference as it indicates to me the user that it is being "captured" by reference and that I should therefore keep the timeout object I provide it around for at least as long as I have the Serial object itself, or that the object will be modified by the function itself. Neither of these do I believe to be true after closer inspection of the code.
If there is data being changed in Timeout (I followed the pimpl implementation through to unix.cc:702) it should be advertised more clearly in the documentation.
Thanks!
The text was updated successfully, but these errors were encountered:
I agree, the setTimeout method should take a const Timeout &. The constructor should probably do the same. I just need to test how the default argument works out in that case.
I'll do this when I get some time, but it would go quicker with a pull request. Also, I'll need to consider how this breaks the ABI/API and then figure out what future release it should be included into.
It's misleading (and inconsistent with the constructor version of the same API) to accept this parameter by non-const reference as it indicates to me the user that it is being "captured" by reference and that I should therefore keep the timeout object I provide it around for at least as long as I have the Serial object itself, or that the object will be modified by the function itself. Neither of these do I believe to be true after closer inspection of the code.
If there is data being changed in Timeout (I followed the pimpl implementation through to unix.cc:702) it should be advertised more clearly in the documentation.
Thanks!
The text was updated successfully, but these errors were encountered: