title: c++ set and shared_ptr
body: <p>I have class X like:</p>
  <pre><code>class X {
      public:
          bool operator&lt;(const SCN&amp; other) const;
  };
  </code></pre>
  <p>Then I have the following code:</p>
  <pre><code>std::multiset&lt;std::shared_ptr&lt;X&gt;&gt; m;
  </code></pre>
  <p>My questions are:</p>
  <ol>
  <li><p>how the data in m is ordered?   the address of <code>X(shared_ptr)</code> or the <code>X.operator&lt;</code>? If it is ordered by address of <code>X</code>, how can I make it order by <code>X.operator&lt;</code>?</p>
  </li>
  <li><p>for this <code>m</code>,  if I want to access its elements from smallest to biggest, can the following code guarantee that? If not, How?</p>
  <pre><code>for (auto&amp; i : m) {
      f(i);
  }
  </code></pre>
  </li>
  </ol>