title: Cascading Function Calls
body: <p>Using a function that looks like:</p>
  
  <pre><code>IntegerSet &amp;insert(int m);
  </code></pre>
  
  <p>I'm trying to create a function that supports cascading calls that insert values into an object's array.</p>
  
  <p>My function:</p>
  
  <pre><code>IntegerSet &amp;IntegerSet::insert(int m) {
      IntegerSet newObj;
      for (int i = 0; i &lt; 256; i++) {
          newObj.set1[i] = set1[i]; //copy the array into the new object
      }
      newObj.set1[m] = true;
      return newObj;
  }
  </code></pre>
  
  <p>The object being returned is empty, which I suspect has to do with the reference.</p>
  
  <p>Attempting to change it by altering the <code>&amp;</code> to look like</p>
  
  <pre><code>IntegerSet IntegerSet::&amp;insert(int m)
  </code></pre>
  
  <p>makes it refuse to compile because it 'expects an identifier'.</p>