Changes between Version 15 and Version 16 of Winter2012/CodingStandardsChanges


Ignore:
Timestamp:
10/05/2011 07:57:07 PM (8 years ago)
Author:
rowen
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Winter2012/CodingStandardsChanges

    v15 v16  
    3535   The TCT accepted this proposal (as a "should"). Robert would like to revisit the topic of importing names in __init__.py files at a future date. 
    3636 
    37  - Functions should only take arguments by shared_ptr when a reference or const reference argument cannot be used.  Examples of when a shared_ptr may be used include when the pointer itself may be reset, when a null pointer is considered a valid input, and when the pointer (not the pointee) will be copied and held after after the function returns (as in a constructor or member function setter).  In all other cases, reference or const reference arguments should be used.  Motivation: it is difficult and sometimes expensive to create a shared_ptr from a reference or plain value, so they should not be required to call functions unless necessary. 
     37 - Functions should only take arguments by shared_ptr when a reference or const reference argument cannot be used.  Examples of when a shared_ptr may be used include when the pointer itself may be reset, when a null pointer is considered a valid input, and when the pointer (not the pointee) will be copied and held after after the function returns (as in a constructor or member function setter).  In all other cases, reference or const reference arguments should be used.  Motivation: it is difficult and sometimes expensive to create a shared_ptr from a reference or plain value, so a shared_ptr should not be required to call functions unless necessary. 
    3838 
    39    The TCT accepted this proposal. This is apparently a new standard; perhaps we can use one of the deleted numbers. 
     39   The TCT accepted this proposal, though Russell plans to go back to the TCT for clarification as to whether this applies to all smart pointers. This is apparently a new standard. Robert would like a future discussion on use of shared_ptr. 
    4040    
    4141 - Russell Owen: 6-6 I wish to change the alternate form for long argument lists or argument lists containing Doxygen annotation as follows (note: in Python the last argument should have a trailing comma, to avoid editing mistakes when changing the argument list).