C++, reference "constructor"
<pre><code>template&lt;typename T, typename R&gt;
T f(R &amp;r) { return T(r); }

int main() {
    int o;
    f&lt;int&amp;&gt;(o);
}
</code></pre>

<p>Is this ok?  Comeau didnt complain, so I assume <code>int&amp;(...)</code> form is fine?</p>

<p>reason example:</p>

<pre><code>    typename boost::mpl::if_c&lt;
        (rank == 1),
        reference,
        tensor_ref&lt;typename detail::array_ref&lt;A&gt;::type&gt;
        &gt;::type
    operator[](const int &amp;i) {
        typedef typename boost::mpl::if_c&lt;
            (rank == 1),
            reference,
            tensor_ref&lt;typename detail::array_ref&lt;A&gt;::type&gt;
                &gt;::type T;
        return T(detail::array_ref&lt;A&gt;::generate(this-&gt;data()));
    }
</code></pre>
