Boost logo

Boost Users :

Subject: [Boost-users] [Lexical Cast] Strange behaviour
From: Robert Jones (robertgbjones_at_[hidden])
Date: 2009-03-17 11:14:50

I know this is not new, but I've just bumped into it....

This code

#include <iostream>
#include <boost/lexical_cast.hpp>

int main(int argc, char* argv[])
    ulong u = boost::lexical_cast<ulong>("-1");
  catch(const std::exception&)

Silently returns ULONG_MAX under MSVC7, though not under GCC. It's
an accuate reflection of how the underlying C library handles it, but do we
to propogate this strangeness?


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at