Boost logo

Boost :

From: Jeff Garland (jeff_at_[hidden])
Date: 2001-07-20 19:14:54


> > Anyway the doc sez -->
> >
> > "Returns the result of streaming arg into a std::stringstream and then out
> as a
> > Target object. The conversion is parameterized by the current
> lexical_context,
> > if set. If the conversion is unsuccessful, a bad_lexical_cast exception is
> > thrown if the current
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > lexical_context is set for throwing or if there is no current
> lexical_context
> > set, otherwise a Target() is returned. "
> >
>
> I saw that, but I didn't think it made it obvious that the int cast would
> fail.
>
> > The more subtle issue is when the double is truncated due to the default
> > precision setting of the stream. This doesn't throw an exception, but
> doesn't
> > give the right correct result either. I think this has been discussed
> > before....
> >
>
> Another good point! And perhaps also worth mentioning in the doc!
>

I totally agree that these usage subtleties would make excellent additions to
the documentation :-)

Jeff


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk