
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Joaquín Mª López Muñoz Sent: 08 October 2007 18:37 To: boost@lists.boost.org Subject: [boost] [lexical_cast][STLport 4.5.3][trunk] static assertion failed in boost/detail/lcast_precision.hpp
Compiling the following snippet in MSVC++ 6.5 + STLport 4.5.3 with the trunk
#include <boost/lexical_cast.hpp>
int main() { return 0; }
results in
...\boost\detail\lcast_precision.hpp(79) : error C2027: use of undefined type 'STATIC_ASSERTION_FAILURE<0>' ...\boost\detail\lcast_precision.hpp(89) : see reference to class template instantiation 'boost::detail::lcast_precision<T>' being compiled [...]
The offending asserion in boost/detail/lcast_precision.hpp is
BOOST_STATIC_ASSERT(!is_specialized_bin || limits::digits + 0UL < ULONG_MAX / 30103UL && precision_bin > limits::digits10 + 0UL && precision_bin <= streamsize_max + 0UL );
This problem did not arise with Boost 1.34 because boost/lexical_cast.hpp did not use the newly created lcast_precision.hpp. Other assertions in lcast_precision<> seem to work OK, so looks like is this particular one that should be fixed only. I lack the skills to propose a patch myself, but I can locally try patches others may provide.
Although I made some input on this, I'm not the maintainer for lexical_cast (and don't have thiese platforms to test). Maintainer is Alexander Nasonov [alexander.nasonov@gmail.com]) but in case he isn't listening: I can't see an obvious cause (presume it works OK on other platforms), so I can only suggest breaking this down into separate assertions to see which one is causing the trouble, and perhaps getting the values of std::limits<T>::digits and boost::is_abstract<T>. It seems that the suitable precision (decimal digits to use to get the full accuracy for type T) can't be calculated. It would also be useful to see what T is? Is this some funny type for which std::numeric_limits isn't properly specialised? HTH Paul --- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539561830 & SMS, Mobile +44 7714 330204 & SMS pbristow@hetp.u-net.com