Github user szenker commented on the pull request:
https://github.com/apache/thrift/pull/798#issuecomment-173337036
Adding the const keyword is not just syntactical sugar. It requires users
which derive from TTransport to be more strict when they implement their own
version of isOpen() and getOrigin() as it enforces them to not alter the
internal state of their custom TTransport implementation when we are calling
one of those methods from the Thrift C++ library. So from the Thrift library
point of view, we can refactor the C++ library and call isOpen() more or less
often without introducing side effects in the users code. peek() should be also
const in my opinion, as it should return true in case data is available for
reading.
@hcorg: I took a quick look into your fork on github (cpp_v2). I really
like the way how you refactored the c++ code generator. How can I get involved
in the refactoring of the cpp_v2 library / compiler? Especially I'm interested
in supporting to refactor the asynchronous client and server. E.g. to add
exception support and the ability to do pipelining.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---