title: C++ code, Read-only variable is not assignable
body: <p>Here's C++ code. I'm confused as to why  dereferencing the iterator tells me the variable is read only? It's a public member of the Node class. What is my error?</p>
  
  <p>adjTable is a set of Node elements -see declarations below.</p>
  
  <pre><code>Cells::iterator pos = adjTable.find(*thisNode);
  if (pos == adjTable.end()) { // Did we find it?
      NSLog(@"Not found");
  // What to do here if node not found
  }
  // We found the node - mark it as grey in the table
  (*pos).colour = grey; // &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; this is the line with the issue
  </code></pre>
  
  <p>Here are the declarations etc.(it doesn't seem to format correctly)</p>
  
  <pre><code>class Node { // Define a single node a.k.a. matrix cell
  public:
      short nodeID;           // the tag from the cell
      short colour;           // for tri-colour used in traversing
      std::vector&lt;short&gt;adjs; // nodeIDs of adjacent nodes
  
      // Ctors
      Node(){};
      Node(short ID, short col, std::vector&lt;short&gt;adjs)
          : nodeID(ID), colour(col), adjs(adjs){}
      // Dtors
      ~Node(){};
      // operators
      bool operator&lt;(const Node&amp; rhs) const{
          return nodeID &lt; rhs.nodeID;
      }
      bool operator==(const Node&amp; rhs) const{
          return nodeID == rhs.nodeID;
      }
  };
  
  typedef std::set&lt;Node,SortNodeSet&gt; Cells;
  class MakeTable {
  public:
      MakeTable(){};
      ~MakeTable(){};
      Cells makeTable();
  };
  </code></pre>