When do i pass by value VS ref/ptr?
<p>I know pointers are 4 (or 8) bytes and they are preferred to copying/passing by value (for an example a 16byte struct/class). But i also heard if you are modifying the value it is better to pass by value because you can potentially elide the copy/construction.</p>

<p>But lets take the below. If we call doubleIt even if its elided the when calling doubleIt, it wont be when calling multiple? What about the return value? Will it be moved efficiently? What happens if theres 3 or 4 layers of functions to call before the class is actually modified?</p>

<pre><code>MyClass multiple(MyClass a, int amount){
    a.memberA*=amount;
    //...
    a.memberZ*=amount;
    return a;
}
MyClass doubleIt(MyClass a){ return multiple(a, 2); }
</code></pre>
