Boost logo

Boost Users :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2007-02-28 01:59:56


Torrey Pines wrote:

> Hi
>
> With the current implementation, unsigned variables accept negative
> values, that get silently cast.
>
> E.g. on my platform, if "--length" expects size_t, --length -32
> assigns it a value 4294967264 without warnings or errors. This
> behavior surprised me, and I'm using a workaround (parsing an int, and
> checking its range manually).
>
> However, is this an intended feature of the library?

Not that I indended it. The library uses lexical_cast to covert
from "-32" to size_t, and I'm suprised you get what you get.

I shall investigage, but would you please file a bug report
about this so that I don't forget?

Thanks,
Volodya


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