C++ Tips: Difference between revisions

Jump to navigation Jump to search
43 bytes added ,  17 January 2014
m
cat: Core developer documentation
m (wiki links)
m (cat: Core developer documentation)
 
Line 76: Line 76:


* Make ownership of objects passed into / out of functions and methods explicit, where possible. This can be done via naming, documentation, use of shared pointers, ref-counted pointers or <tt>std::auto_ptr</tt>, to name a few possibilities. It's always better to ensure a method can only be called the 'right' way, rather than trying to document the intended behaviour and hope people respect it.
* Make ownership of objects passed into / out of functions and methods explicit, where possible. This can be done via naming, documentation, use of shared pointers, ref-counted pointers or <tt>std::auto_ptr</tt>, to name a few possibilities. It's always better to ensure a method can only be called the 'right' way, rather than trying to document the intended behaviour and hope people respect it.
[[Category:Core developer documentation]]

Navigation menu