add note about generally passing built in types by value - for most compilers this should be faster
This commit is contained in:
parent
84c9ee653a
commit
7a9c5ac0ed
1 changed files with 6 additions and 0 deletions
|
@ -101,6 +101,12 @@ If you see bits of code around that do not follow these please don't hesitate to
|
||||||
|
|
||||||
std::string const& variable_name // no
|
std::string const& variable_name // no
|
||||||
|
|
||||||
|
#### Pass built-in types by value, all others by const&
|
||||||
|
|
||||||
|
void my_function(int double val); // if int, char, double, etc pass by value
|
||||||
|
|
||||||
|
void my_function(std::string const& val); // if std::string or user type, pass by const&
|
||||||
|
|
||||||
#### Shared pointers should be created with [boost::make_shared](http://www.boost.org/doc/libs/1_47_0/libs/smart_ptr/make_shared.html) where possible
|
#### Shared pointers should be created with [boost::make_shared](http://www.boost.org/doc/libs/1_47_0/libs/smart_ptr/make_shared.html) where possible
|
||||||
|
|
||||||
#### Function definitions should not be separated from their arguments:
|
#### Function definitions should not be separated from their arguments:
|
||||||
|
|
Loading…
Reference in a new issue