title: std::stod ignores nonnumerical values after decimal place
body: <p>I am reading in a value with a string, then converting it to a double. I expect an input such as <code>2.d</code> to fail with std::stod, but it returns <code>2</code>. Is there a way to ensure that there is no character in the input string at all with std::stod?</p>
  
  <p>Example code:</p>
  
  <pre><code>string exampleS = "2.d"
  double exampleD = 0;
  try {
    exampleD = stod(exampleS); // this should fail
  } catch (exception &amp;e) {
    // failure condition
  }
  cerr &lt;&lt; exampleD &lt;&lt; endl;
  </code></pre>
  
  <p>This code should print <code>0</code> but it prints <code>2</code>. If the character is before the decimal place, stod throws an exception.</p>
  
  <p>Is there a way to make std::stod (and I'm assuming the same behavior also occurs with std::stof) fail on inputs such as these?</p>