typedef typename boost::uint_t&lt;bits&gt;::least t;<br><br>Will work.<br><br>Kobi.<br><br><div><span class="gmail_quote">On 7/7/06, <b class="gmail_sendername">Phil Endecott</b> &lt;<a href="mailto:spam_from_boost_users@chezphil.org">
spam_from_boost_users@chezphil.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Dear All,<br><br>I am having trouble using the integer library.&nbsp;&nbsp;The following fails
<br>to compile:<br><br>#include &lt;boost/integer.hpp&gt;<br><br>template &lt;int bits&gt;<br>void fn(void)<br>{<br>&nbsp;&nbsp;//typedef boost::uint_t&lt;8&gt;::least t;<br>&nbsp;&nbsp;typedef boost::uint_t&lt;bits&gt;::least t;<br>&nbsp;&nbsp;t var;
<br>}<br><br><br>int main(int argc, char* argv)<br>{<br>&nbsp;&nbsp;fn&lt;8&gt;();<br>}<br><br><br>With g++ 4.0.0 on Linux and Boost 1.32, I get:<br><br>boost_int_test.cc: In function ‘void fn()’:<br>boost_int_test.cc:7: error: expected initializer before ‘t’
<br>boost_int_test.cc:8: error: ‘t’ was not declared in this scope<br>boost_int_test.cc:8: error: expected `;' before ‘var’<br><br><br>The problem seems to occur when I use a template parameter - &quot;bits&quot;<br>
in this case - as the template parameter to uint_t.&nbsp;&nbsp;If I use a<br>constant (as in the commented-out line) it works.<br><br>Is this a C++ feature, or a bug somewhere?&nbsp;&nbsp;Can anyone suggest a<br>workaround?<br><br>Thanks,<br>
<br>Phil.<br><br><br><br><br>_______________________________________________<br>Boost-users mailing list<br><a href="mailto:Boost-users@lists.boost.org">Boost-users@lists.boost.org</a><br><a href="http://lists.boost.org/mailman/listinfo.cgi/boost-users">
http://lists.boost.org/mailman/listinfo.cgi/boost-users</a><br><br></blockquote></div><br><br clear="all"><br>-- <br>- Kobi