title: g++ compiler option to warn about type conversions with ublas::bounded_vector
body: <p>Consider the following code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;boost/numeric/ublas/vector.hpp&gt;
  #include &lt;boost/numeric/ublas/io.hpp&gt;
  
  int main()
  {
      namespace ublas = boost::numeric::ublas;
  
      double   d = M_PI;
      unsigned u = d;
  
      std::cout &lt;&lt; "d = " &lt;&lt; d &lt;&lt; std::endl;
      std::cout &lt;&lt; "u = " &lt;&lt; u &lt;&lt; std::endl;
  
      ublas::bounded_vector&lt;double,3&gt;   dVec = ublas::scalar_vector&lt;double&gt;(3,M_PI);
      ublas::bounded_vector&lt;unsigned,3&gt; uVec = dVec; // type conversion!
  
      std::cout &lt;&lt; "dVec = " &lt;&lt; dVec &lt;&lt; std::endl;
      std::cout &lt;&lt; "uVec = " &lt;&lt; uVec &lt;&lt; std::endl;
  
      return 0;
  }
  </code></pre>
  
  <p>When I compile this using g++ (version 4.6.1) with the following options:</p>
  
  <pre><code>g++  -g3 -Wall -Wextra -ansi -pedantic -Wconversion -std=c++0x test.cpp -o test
  </code></pre>
  
  <p>I get the following warnings:</p>
  
  <pre><code>test.cpp: In function ‘int main()’:
  test.cpp:11:22: warning: conversion to ‘unsigned int’ from ‘double’ may alter its value [-Wconversion]
  </code></pre>
  
  <p>When I run the program I get:</p>
  
  <pre><code>$ ./test
  d = 3.14159
  u = 3
  dVec = [3](3.14159,3.14159,3.14159)
  uVec = [3](3,3,3)
  </code></pre>
  
  <p>The compiler produced a warning for the conversion of the scalars but there was no warning for the ublas conversion, is there a way of having the compiler write a warning in that case? It looks like <code>-Wconversion</code> or any of the other options don't do this.</p>