typedef typename boost::uint_t<bits>::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> <<a href="mailto:spam_from_boost_users@chezphil.org"> spam_from_boost_users@chezphil.org</a>> 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. The following fails <br>to compile:<br><br>#include <boost/integer.hpp><br><br>template <int bits><br>void fn(void)<br>{<br> //typedef boost::uint_t<8>::least t;<br> typedef boost::uint_t<bits>::least t;<br> t var; <br>}<br><br><br>int main(int argc, char* argv)<br>{<br> fn<8>();<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 - "bits"<br> in this case - as the template parameter to uint_t. 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? 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