Rvalue references in g++
<p>I'm changing the compiler from Visual Studio to g++, and having some problems with pass by reference in function arguments.</p>

<p>In Visual Studio, the function is:</p>

<pre><code>void Foo(int&amp;a, int&amp;b)
</code></pre>

<p>So that a, b are modified in this function. Therefore I can't use in g++</p>

<pre><code>void Foo(const int&amp;a, const int &amp;b)
</code></pre>

<p>And also rvalue reference is not allowed in my g++:</p>

<pre><code>void Foo( int&amp;&amp; a, int&amp;&amp; b)
</code></pre>

<p>So is using pointer is the only way to convert the code?</p>

<pre><code>void Foo( int* a, int* b)
</code></pre>

<p>P/S: This is the error when compiling with g++:</p>

<pre><code>error: no matching function for call to ‘Steerable::buildSCFpyrLevs(Tensor&lt;double, 2ul&gt;, std::vector&lt;Tensor&lt;double, 2ul&gt; &gt;&amp;, int&amp;, int&amp;, int&amp;, bool&amp;)’
Steerable.cpp:63:100: note: candidate is:
Steerable.h:93:7: note: void Steerable::buildSCFpyrLevs(Steerable::data_ref, std::vector&lt;Tensor&lt;double, 2ul&gt; &gt;&amp;, int, int, int, bool)
Steerable.h:93:7: note:   no known conversion for argument 1 from ‘Tensor&lt;double, 2ul&gt;’ to ‘Steerable::data_ref {aka Tensor&lt;double, 2ul&gt;&amp;}’
</code></pre>

<p>And the function declarations are:</p>

<pre><code>typedef Tensor&lt;value_type,2&gt; data_type;
typedef data_type&amp; data_ref;


vector&lt;Steerable::data_type&gt;&amp; Steerable::buildSCFpyr(Steerable::c_data_ref im, int nLevel, int nDir, int twidth, bool subsample)
</code></pre>

<p>The line which has the error:</p>

<pre><code>buildSCFpyrLevs(imdft.FreqComplexFilter(toComplex(lo0mask)),pyr_freq,nLevel,nDir,twidth, subsample);
</code></pre>
