Using friend to reduce verbosity
<p>Is it considered a good practice to use <code>friend</code> to define global functions within the class definition, even when the access to private members is not needed. For example</p>

<pre><code>template&lt;typename T&gt;
class A {
public:
    A(T v);
    T value() const;

    friend A operator+(T n, const A&amp; a) {
        return A(a.value() + n);
    }
};
</code></pre>

<p>instead of</p>

<pre><code>template&lt;typename T&gt;
class A {
public:
    A(T v);
    T value() const;
};

template&lt;typename T&gt;
A&lt;T&gt; operator+(T n, const A&lt;T&gt;&amp; a) {
    return A&lt;T&gt;(a.value() + n);
}
</code></pre>

<p>even though <code>operator+</code> only uses <code>value()</code> which is public.
Is this commonly done, us is it not recommended?</p>