title: C++ std::copy from std::deque to std:;set
body: <p>I have a class with "array of array" private member represented as:</p>
  
  <pre><code>std::deque&lt;std::deque&lt;SomeClass&gt; &gt; someArray_;
  </code></pre>
  
  <p>Also this class have a public method which allows to receive all unique <code>SomeClass</code> instances, containing in <code>someArray_</code>. Unique for <code>SomeClass</code> instances means different by at least one of several class members. I decided to use <code>std::set</code> for that purpose. This method has prototype like following: </p>
  
  <pre><code>std::set&lt;SomeClass&gt; getAllUniqueInstances() const;
  </code></pre>
  
  <p>In this method implementation I use following construction to populate <code>std::set</code>:</p>
  
  <pre><code>std::set&lt;SomeClass&gt; allUniqueInstances;
  for(auto it = std::begin(someArray_); it != std::end(someArray_); ++it){
      std::copy((*it).begin(), 
                (*it).end(),
                std::inserter(allUniqueInstances, allUniqueInstances.end()));
  }
  </code></pre>
  
  <p><code>operator&lt;()</code> is defined for <code>SomeClass</code> class. As a result my <code>std::set</code> is populated, but huge amount of instances is missed. Modyfing <code>operator&lt;()</code> for <code>SomeClass</code> class, alters situation, but breaks desirable sorting order. How in this case <code>std::copy</code> determines whether considerable instance is unique?</p>
  
  <p><strong>UPD</strong>: source code for <code>SomeClass</code></p>
  
  <pre><code>class SomeClass{
      private:
          uint32_t from_;
          uint32_t to_;
          double capacity_;
          double flow_;
      public:        
          ...
          bool operator&lt;(const SomeClass&amp; rhs) const;
          ...
      };
  </code></pre>
  
  <p>I want <code>SomeClass</code> instances to be ordered in set by <code>from_</code> member:</p>
  
  <pre><code>bool SomeClass::operator&lt;( const SomeClass&amp; rhs ) const{
      if(this-&gt;from_ &lt; rhs.from_)
          return true;    
      return false;    
  }
  </code></pre>