title: sort std::set using operator() to order the insertions
body: <p>I am continuing this post after <a href="https://stackoverflow.com/questions/12576763/how-to-sort-a-stdset-with-const-getters"><strong>This</strong></a>
   we have a class as:</p>
  
  <pre><code>class LaneConnector {
  public:
  
      const Lane* getLaneFrom() const {
          return From;
      }
      const Lane* getLaneTo() const {
          return To;
      }
  
  private:
  
      Lane* From;
      Lane* To;
  }
  </code></pre>
  
  <p>and a functor to compare as:</p>
  
  <pre><code>struct MyLaneConectorSorter {
    bool operator() (const LaneConnector* rhs, const LaneConnector* lhs) const
    {
      // you may want to put some null pointer checks in here
      const Lane* a = lhs-&gt;getLaneFrom();
      const Lane* b = rhs-&gt;getLaneFrom();
      return a-&gt;getLaneID() &lt; b-&gt;getLaneID();
    }
  };
  </code></pre>
  
  <p>and finally a source and destination set:</p>
  
  <pre><code>const std::set&lt;LaneConnector*&gt; src = ..... ;
  
  const std::set&lt;LaneConnector*, MyLaneConectorSorter&gt; dest(src.begin(), src.end(), MyLaneConectorSorter());
  </code></pre>
  
  <p>The size of the dest set will be 1 while the src has more(14 in my case)</p>
  
  <p>what might have I done wrong? I value your kind comments. Thank you</p>