title: No operator "=" matches these operands - Iterators from the Standard Template Library
body: <p>Okay, I'm working on a project for school, and we need to have a linked list of a class within another class (a linked list of the class "task" inside a class called "objectives"), so for this i'm using the STL class . Now I <em>almost</em> have it set up, but in my display function, to display the contents of the tasks, I'm using an iterator. But I can't assign taskList.begin() to the iterator because it gives me an error.</p>
  
  <p>The following is the code that I think is relevant.</p>
  
  <p>objective.h</p>
  
  <pre><code>    #ifndef OBJECTIVE_H
      #define OBJECTIVE_H
      #include &lt;string&gt;
      #include &lt;list&gt;
      #include "date.h"
      #include "task.h"
      using namespace std;
      namespace team2
      {
        class objective
        {
              private:
                  string objective_name, objective_desc, resources[10];
                  int category, priority, res_used;
                  double time;
                  date start, end;
                  int status;
                  std::list&lt;task&gt; taskList;
  
              public:
                  // CONSTRUCTORS
                  objective();
                  objective(string objN, string objD, int c, int p, date s, date e, double t, string res[], int resU, int stat, list&lt;task&gt;&amp; tList);
  
  ...
  
                  // CONSTANT MEMBER FUNCTIONS
                  void display() const;
  ...
        };
      }
      #endif
  </code></pre>
  
  <p>objective.cpp (This is where I get the error)</p>
  
  <pre><code>#include "objective.h"
  #include "date.h"
  #include &lt;cstdlib&gt;
  #include &lt;cassert&gt;
  #include &lt;string&gt;
  #include &lt;list&gt;
  #include "task.h"
  using namespace std;
  
  namespace team2
  {
      void objective::display() const // display() - Displays the complete contents of a single objective
      {
          int days, hours, minutes;
          std::list&lt;task&gt;::iterator taskIterator;
  
          days = floor(time/24.0); // Find the max number of days based off of the time (in hours)
          hours = floor(time - days*24); // Find the max number of hours after deduction of days
          minutes = floor((time - (days*24 + hours))*60); // Find the number or minutes after taking into account hours and days
  
          cout &lt;&lt; "\nObjective Name: " &lt;&lt; objective_name &lt;&lt; endl;
          cout &lt;&lt; "Objective Description: " &lt;&lt; objective_desc &lt;&lt; endl;
          cout &lt;&lt; "Category: Quad " &lt;&lt; category &lt;&lt; endl;
          cout &lt;&lt; "Priority: " &lt;&lt; priority &lt;&lt; endl;
          cout &lt;&lt; "Starting Date: " &lt;&lt; start.getMonth() &lt;&lt; "/" &lt;&lt; start.getDay() &lt;&lt; "/" &lt;&lt; start.getYear() &lt;&lt; endl;
          cout &lt;&lt; "Ending Date: " &lt;&lt; end.getMonth() &lt;&lt; "/" &lt;&lt; end.getDay() &lt;&lt; "/" &lt;&lt; end.getYear() &lt;&lt; endl;
          cout &lt;&lt; "Time Required: " &lt;&lt; days &lt;&lt; " Days " &lt;&lt; hours &lt;&lt; " Hours " &lt;&lt; minutes &lt;&lt; " Minutes " &lt;&lt; endl;
          cout &lt;&lt; "Resources: " &lt;&lt; endl;
              if(res_used == 0)
                  cout &lt;&lt; "\tNo Resources" &lt;&lt; endl;
              for(int i = 0; i &lt; res_used; i++)
                  cout &lt;&lt; "\t" &lt;&lt; resources [i] &lt;&lt; endl;
  
          cout &lt;&lt; "Current Status: ";
              if(status == 1)
                  cout &lt;&lt; "Completed" &lt;&lt; endl;
              else if(status == 0)
                  cout &lt;&lt; "Incomplete" &lt;&lt; endl;
          cout &lt;&lt; "Tasks: " &lt;&lt; endl;
              if(taskList.empty())
                  cout &lt;&lt; "\tNo Resources" &lt;&lt; endl;
              for(taskIterator = taskList.begin(); taskIterator != taskList.end(); taskIterator++)
              {
                   (*taskIterator).display();
                   cout &lt;&lt; endl;
               }
      }
  }
  </code></pre>
  
  <p>The tasks class is almost Identical to the objective class, with a few fields omitted. The error occurs in the for loop. for(taskIterator = taskList.begin();...) Anyone know the cause for the problem? I can also provide more code if necessary. Thank you in advance!</p>