title: boost multi_index - how to iterate through it if element type supports move-semantic only?
body: <pre><code>typedef boost::multi_index_container&lt;foo, ...
  
  struct foo {
      ...
      std::unique_ptr&lt;Bar&gt; bar; // requires move-semantic only
      foo() { bar = std::make_unique&lt;Bar&gt;(); }
      foo(foo&amp;&amp;) = default;
  };
  </code></pre>
  
  <p>I haven't any problems with <code>push_back</code> - just using <code>push_back(std::move(...))</code>.</p>
  
  <p>Also, no problems with:</p>
  
  <pre><code>auto it = container.get&lt;...&gt;().find(...);
  container.erase(it);
  </code></pre>
  
  <p>But I also need iterate all elements of container. I doing:</p>
  
  <pre><code>for (auto it = container.begin(); auto it = container.end(); ++it) {
     some_foo(*it); // For instance, another_container_of_same_type.push_back(*it) - to merge 2 containers
  }
  </code></pre>
  
  <p>Or, in special case:</p>
  
  <pre><code>for (auto it = container.begin(); auto it = container.end(); ++it) {
     // some logics
     another_container_of_same_type.push_back(*it); //another container defined same as first one
     // some logics
  }
  </code></pre>
  
  <p>And it not compiles!</p>
  
  <p>I tried:</p>
  
  <pre><code>some_foo(std::move(*it))
  some_foo(std::move(it))
  some_foo(it)
  some_foo(*it)
  </code></pre>
  
  <p>Not compiles. It wants copying constructor nor moving...</p>
  
  <p><strong>Warning: NO, it is not simply merging two containers, I using my custom logics in the merging, also using iterating not for merging only.</strong></p>