title: 'non-static reference member, can't use default assignment operator'
body: <p>I get this error when i try to compile my code:
  <code>non-static reference member ‘Timestep&amp; Timestep::previousTimestep’, can’t use default assignment operator</code></p>
  
  <p>I create one <code>Problem</code> which creates a <code>Timestep</code> a reference to the this <code>Timestep</code>should be stored in the vector <code>solution</code>. Besides i want to store a reference to a previous <code>Timestep</code> - and for the first Timestep that would be a reference to itself... </p>
  
  <p>I read that i need to define an own operator if i have <code>const</code> members in a class what i try to set equal. However, removed all <code>const</code> elements form the code and it still don't work. Any suggestions? Thanks a lot.</p>
  
  <pre><code>class Problem {
  public:
      void initialTimestep(arma::vec ic);
  private:
      std::vector&lt;Timestep&gt; solution;
  };
  
  void Problem::initialTimestep(vec ic){
      Timestep myFirstTimestep(starttime, ic, nodes);
      solution.push_back(myFirstTimestep);
  }
  
  
  
  class Timestep {
  public:
      Timestep(double starttime, arma::vec initialCondition, arma::vec nodelist);
  private:
      Timestep&amp; previousTimestep; //const
  };
  
  Timestep::Timestep(double starttime, vec initialCondition, vec nodelist)
  : previousTimestep(*this)
      {
      //do stuff
  }
  
  
  int main() {
      int k = 3; //subdomains
      vec v = linspace(0., 1., k+1); //node spacing
      vec ic= ones&lt;vec&gt;(k+1); //initialconditions
      Problem myProblem(v, ic, 0., 1., 0.1);
      return 0;
  }
  </code></pre>