title: What is returned if list::remove() is used for an element that doesn't exist?
body: <p>Say I have a list:</p>
  <p><code>list&lt;int&gt; A { 1, 2, 3, 4};</code></p>
  <p>and I do this:</p>
  <p><code>A.remove(5);</code></p>
  <p>What would be returned by this?  When I create a simple program for this in Visual Studio, it runs without giving any errors, so I am assuming it is a legal statement.</p>
  <p>However, what if I wanted to keep track of whether or not the element is removed, and print out that it has either been removed or the element does not exist?</p>
  <p>For example, is there something like this:</p>
  <pre class="lang-cpp prettyprint-override"><code>if (A.remove(5) == true) {
      cout &lt;&lt; &quot;Element has been removed&quot; &lt;&lt; endl;
  } else {
      cout &lt;&lt; &quot;Element does not exist&quot; &lt;&lt; endl;
  }
  </code></pre>
  <p>that can be done without looping through the list and comparing 5 to every element if it exists before first calling the <code>remove()</code> function?</p>