title: Trying to subtract a std::chrono::duration from a time_point (C++), but my code isn't compiling. Any suggestions?
body: <p>I asked this question yesterday, but my thread got shut down, so I'm talking into the void. So, my code is not compiling, but I would very much like it to. Here's is my snippet:</p>
  <pre><code>float numSeconds = 50;
  std::chrono::steady_clock::time_point startTime = std::chrono::steady_clock::now();
  auto duration = std::chrono::duration&lt;float, std::chrono::seconds&gt;(numSeconds);
  startTime -= duration;
  </code></pre>
  <p>Seems like it should be pretty straightforward, but I'm getting an operator not found error when attempting the in-place subtraction. Any suggestions?  I've also tried replacing the third line with the following:</p>
  <pre><code>   auto duration = std::chrono::duration&lt;float, std::ratio&lt;1, 1&gt;&gt;(numSeconds);
  </code></pre>
  <p>However, that line doesn't seem to be the cause of the issues, both approaches seem valid. It's my final line still that is unhappy. The error code I am getting is:</p>
  <pre><code>&quot;Error  C2679   binary '-=': no operator found which takes a right-hand operand of type 'std::chrono::duration&lt;float,std::chrono::seconds&gt;' (or there is no acceptable conversion)&quot;
  </code></pre>
  <p>Additionally, when I change the last line to:</p>
  <pre><code>timer.m_startTime = timer.m_startTime - duration;
  </code></pre>
  <p>I get the following error code:</p>
  <pre><code>Error   C2679   binary '=': no operator found which takes a right-hand operand of type 'std::chrono::time_point&lt;std::chrono::steady_clock,std::chrono::duration&lt;float,std::ratio&lt;1,1000000000&gt;&gt;&gt;' (or there is no acceptable conversion)
  </code></pre>
  <p>Are these somehow incompatible types? I would think that they'd resolve to the same thing.</p>