Using boost::ref to indicate intention in coding conventions <p>When functions take non-const refs as arguments, it can create hard-to-read code because at the calling site it is not obvious which inputs might be changed. This has lead some code conventions to enforce that pointers be used instead, for example</p> <pre><code>void func(int input, int* output); int input = 1, output = 0; func(input, &amp;output); </code></pre> <p>instead of</p> <pre><code>void func(int input, int&amp; output); int input = 1, output = 0; func(input, output); </code></pre> <p>Personally, I hate using pointers because of the need to check for null. This has lead me to wonder if boost::ref (or std::ref for C++11) can be used to signal intention, as follows:</p> <pre><code>void func(int input, int&amp; output); int input = 1, output = 0; func(input, boost::ref(output)); </code></pre> <p>This would be used as a company coding convention. <strong>My question is, are there any reasons why this would not be a good idea?</strong></p>