title: Cast boost::units type into numeric types
body: <p>I am using the <code>boost::units</code> library. My problem is that I have to cast my length vector into a double vector for a cmath calculation:</p>
  
  <pre><code>  pow(tmpVector.at(cnt),cnt) 
  </code></pre>
  
  <p>cnt is my loop counter. If I try the calculation without casting I revive the error that there is no casting definition for <code>boost::units::length</code> into <code>double</code>. </p>
  
  <p>I tried to use static_cast which don't work and numeric_cast of the boost library which also doesn't work. In the second case I receive the following compiler error:</p>
  
  <pre><code>e:\testvs12\libraries\thirdparty\boost\boost\numeric\conversion\converter_policies.hpp(187): error C2440: 'static_cast': 'const std::vector&lt;_Ty&gt;' can not convert into 'std::vector&lt;_Ty&gt;' 
  </code></pre>
  
  <p>I found nothing in the internet - I hope one of you can help me</p>
  
  <p>Question 1: is there a possibility to use pow inside a loop with <code>boost::units</code> and the loop counter as exponent?</p>
  
  <p>Question 2: how can I cast a <code>boost::units</code> type into e.g. a double?</p>
  
  <p>Thanks in advance.</p>