title: merged list doesn't show in the terminal
body: <pre><code>#include &lt;iostream&gt;
  #include &lt;list&gt;
  #include &lt;algorithm&gt;
  #include &lt;string&gt;
  using namespace std;
  
  void out(string&amp; str) {cout &lt;&lt; str &lt;&lt; &quot; &quot;;}
  
  int main()
  {
      list&lt;string&gt; lm;
      list&lt;string&gt; lp;
      string temp;
      cout &lt;&lt; &quot;List of Mat (quit to quit):\n&quot;;
      while (cin &gt;&gt; temp &amp;&amp; temp != &quot;quit&quot;)
          lm.push_back(temp);
      lm.sort();
      for_each(lm.begin(), lm.end(), out);
      cout &lt;&lt; endl;
      cout &lt;&lt; &quot;Mat completed.\n&quot;;
      cout &lt;&lt; &quot;List of Pat (quit to quit):\n&quot;;
      while (cin &gt;&gt; temp &amp;&amp; temp != &quot;quit&quot;)
          lp.push_back(temp);
      for_each(lp.begin(), lp.end(), out);
      cout &lt;&lt; endl;
  
      list&lt;string&gt; merged;
      merge(lm.begin(), lm.end(), lp.begin(), lp.end(), merged.begin());
      cout &lt;&lt; &quot;Merged list (sorted):\n&quot;;
      merged.sort();
      merged.unique();
      for_each(merged.begin(), merged.end(), out);
      cout &lt;&lt; endl;
  
      return 0;
  }
  </code></pre>
  <p>I tested the program by inputting &quot;a t g c&quot; for <code>lm</code>, and &quot;u a k g&quot; for <code>lp</code>. The sizes of <code>lm</code> and <code>lp</code> were both 4.</p>
  <p>But after <code>merge(lm.begin(), lm.end(), lp.begin(), lp.end(), merged.begin());</code>, the size of merge seemed infinite and the merged couldn't show in the terminal.</p>
  <p>I was wondering if there's something wrong with my using of <code>merge</code>, or there was other problem. Thanks!!!</p>