title: Why does std::chrono::time_point doesn't like arithmetics?
body: <p>I was simply trying to measure the time passed between to time points:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;chrono&gt;
  
  int main(){
  //    std::chrono::time_point start1;  // &lt;-- doesn't work
  //    std::chrono::time_point end1;    // &lt;-- doesn't work
      auto start1;                       // &lt;-- does work
      auto end1;                         // &lt;-- does work
  
      start1 = std::chrono::high_resolution_clock::now();
      std::cout&lt;&lt;"Hello, World!"&lt;&lt;std::endl;
      end1 = std::chrono::high_resolution_clock::now();
  
      std::cout &lt;&lt; std::chrono::duration_cast&lt;std::chrono::microseconds&gt;(end1 - start1).count() &lt;&lt; std::endl;
  
      return 0;
  }
  </code></pre>
  
  <p>...and I noticed that <code>start1</code> and <code>end1</code> have to be defined with the <code>auto</code> type. If I explicitly define them with the type <code>std::chrono::time_point</code> the expression <code>end1 - start1</code> gives me "<em>binary operator '-' can not be applied to...</em>".</p>
  
  <p>Why can I use arithmetic operators on <code>start1</code> and <code>end1</code> if they are defined with <code>auto</code>? Does <code>auto</code> automatically cast them into something that is compatible with arithmetic operators? I thought <code>auto</code> should just be the shorthand for the compiler to look what <code>std::chrono::high_resolution_clock::now()</code> returns type is?!</p>