[ 
https://issues.apache.org/jira/browse/THRIFT-3560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15113647#comment-15113647
 ] 

ASF GitHub Bot commented on THRIFT-3560:
----------------------------------------

Github user nsuke commented on the pull request:

    https://github.com/apache/thrift/pull/798#issuecomment-174161478
  
    @szenker thanks for elaborating.
    I believe a minor ease of refactoring is not enough for silently ignored 
(non-)overrides.
    But if your plan of `peek` solves an existing nasty pitfall or something, 
please do share your thought.
    Also I agree that it's not much of an issue for _v2.
    
    A minor nit: if we're changing `getOrigin` signature at all, I think the 
return type should be changed to  non-const (or reference).
    
    And another thing to consider for const under C++11: it now arguably 
signifies non data race guarantee.
    http://herbsutter.com/2013/01/01/video-you-dont-know-const-and-mutable/
    For example `TSocket::getOrigin` involves some system calls and internal 
caching that we may need synchronization.


> C++ TTransport::isOpen() and TTransport::getOrigin() should be const member 
> functions
> -------------------------------------------------------------------------------------
>
>                 Key: THRIFT-3560
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3560
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.9.3, 0.9.4, 1.0
>            Reporter: Sebastian Zenker
>            Priority: Minor
>              Labels: easyfix
>
> ... as they should not alter the state of TTransport. Also peek() should be 
> const in my opinion, but this requires some more refactoring.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to