title: Is there a way get an integer out of boost::any if you don't know if original type was signed or unsigned
body: <p>I'm using <code>boost::any</code> in combination with <code>boost::any_cast&lt;&gt;</code> to write some framework code which should take a set of arguments, almost like a function call, and convert them into an array of <code>boost::any</code> types.</p>
  
  <p>So far everything has been working great, except in places where it is hard to predict if the number the caller gives me is going to be signed or unsigned.  A lot of code in our existing product (windows based) uses <code>DWORD</code> and <code>BYTE</code> data types for local variables so if one of those variables is used, I get unsigned type.  However if a constant is hardcoded, the most likely it'll be a simple number in which case it will be signed.</p>
  
  <p>Since I can't predict if I should do <code>any_cast&lt;int&gt;</code> or <code>any_cast&lt;unsigned int&gt;</code>, 50% of the time my code that reads the <code>boost::any</code> array will fail.</p>
  
  <p>Does anyone know if there's a way to just a number out of <code>boost::any</code> regardless if original type was signed or unsigned?</p>