diff --git a/docs/contributing.markdown b/docs/contributing.markdown index d733242d6..36b6b8d01 100644 --- a/docs/contributing.markdown +++ b/docs/contributing.markdown @@ -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 +#### 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 #### Function definitions should not be separated from their arguments: