title: Unable to identify solution to compiler error using Boost Units
body: <p><strong>Boost Units version</strong>: 1.45</p>
  
  <p><strong>Compiler</strong>: Visual Studio 2008</p>
  
  <p><strong>Platform</strong>: Windows 7</p>
  
  <p><strong>Error</strong>: When compiling the following code I get an error C2440 "initializing' : cannot convert from 'boost::units::quantity' to 'boost::units::quantity' with</p>
  
  <p><code>[
  Unit=boost::units::unit&gt;,boost::units::detail::static_power_impl&lt;0&gt;::apply&gt;::type,boost::units::hogogeneous_system&gt;&gt;&gt;&gt;,
  Y = double
  ]</code></p>
  
  <p>and</p>
  
  <p><code>[
  Unit=myproject::types::myproject_length
  ]</code></p>
  
  <p>Constructor for class 'boost::units::quantity' is declared 'explicit' with</p>
  
  <p><code>[
  Unit=myproject::types::myproject_length
  ]</code></p>
  
  <p>I am not sure what is wrong here. If I remove the "radii_t result =" from the following code and comment out the IO statement I get the same error as previously quoted above.
  Below is the code I used. I appreciate your patience as I learn Boost
  Units.</p>
  
  <p>Q1: What is the reason for this error? What in the error output helped
  you to figure that out.</p>
  
  <p>Q2: Even if the above error did not exist you mentioned that it would
  fail the dimensional analysis. I think we both agree the type would be
  radii^-1. How do you declare a type to be raised to the correct power?</p>
  
  <p>Stephen</p>
  
  <pre><code>#include &lt;boost/units/base_unit.hpp&gt;
  #include &lt;boost/units/base_units/angle/radian.hpp&gt;
  #include &lt;boost/units/io.hpp&gt;
  #include &lt;boost/units/make_system.hpp&gt;
  #include &lt;boost/units/physical_dimensions/length.hpp&gt;
  #include &lt;boost/units/physical_dimensions/time.hpp&gt;
  #include &lt;boost/units/static_constant.hpp&gt;
  
  #include &lt;iostream&gt;
  
  namespace myproject {
   namespace types {
  
     //-------------------------------------
     //          Base dimensions
     //-------------------------------------
     struct length_base_dimension : public boost::units::base_dimension&lt;length_base_dimension,1&gt; {};
  
     //-------------------------------------
     //          Dimensions
     //-------------------------------------
  
     struct radii_base_unit : public boost::units::base_unit&lt;radii_base_unit, boost::units::length_dimension, 1&gt;
     {
       static std::string name()   { return("radii"); }
       static std::string symbol() { return("r"); }
     };
  
     struct minute_base_unit : public boost::units::base_unit&lt;minute_base_unit,boost::units::time_dimension,3&gt;
     {
       static std::string name() { return ("minute"); }
       static std::string symbol() { return ("min"); }
     };
  
  typedef boost::units::make_system&lt;radii_base_unit,
                                   minute_base_unit,
                                   boost::units::angle::radian_base_unit &gt;::type myproject_system_t;
  
     typedef boost::units::unit&lt;boost::units::length_dimension,myproject_system_t&gt; myproject_length;
  
     typedef boost::units::quantity&lt;myproject_length, double&gt; radii_t;
  
     BOOST_UNITS_STATIC_CONSTANT(radii,myproject_length);
   }
  }
  
  int main ( int, char** )
  {
   using namespace myproject::types;
  
   radii_t val1 ( 5 * radii );
   radii_t val2 ( 3 * radii );
  
   radii_t result =  1.0 / ( val1 - val2 );
  
   std::cout &lt;&lt; result &lt;&lt; std::endl;
  
   return 0;
  }
  </code></pre>