title: Units for types in C++
body: <p>In the <a href="https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines" rel="noreferrer">C++ Core Guidlines</a> P.1 <code>change_speed</code> example, it shows a <code>Speed</code> type that is used as shown below:</p>
  
  <pre><code>change_speed(Speed s); // better: the meaning of s is specified
  // ...
  change_speed(2.3); // error: no unit
  change_speed(23m / 10s); // meters per second
  </code></pre>
  
  <p>I am particularly interested in the last two lines of this example.  The first seems to suggest that if you provide no units with the argument to <code>change_speed</code> it will throw an error.  The last line shows the units defined using some the <code>m</code> and <code>s</code> literals.  Are both of these new features in modern versions of C++?  If so, how would something like this be implemented, and what version of C++ is required?</p>