$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
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[])
{
try
{
ulong u = boost::lexical_cast<ulong>("-1");
cout<<"Conversion"<
}
catch(const std::exception&)
{
cout<<"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
want
to propogate this strangeness?
Rob.