Boost logo

Boost Users :

From: Ô¬Ïþ»Ô (farproc_at_[hidden])
Date: 2006-07-24 07:52:37


Hi,all

I want to cast string to long long type and handle overflow. I tested as
follow.

long long somevar = lexical_cast<long
long>("123456789789789798879977978789787987879879787977897897897899879978798798798");//!!!!!!!!!!!!!!

But it does not throw an exception!!

It seem that casting to int does not have this kind of problem.

int somevar2 =
lexical_cast<int>("123456789789789798879977978789787987879");//will throw an
exception



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net