> From: Stiphane Bronsart [mailto:email@example.com]
> I don't say that this solution is magic, nor that it's has to
> be put in
> boost (or modify lexical_cast) but : lexical_cast has limit
> and/or bug in it
> signed short i = lexical_cast<signed short>("60000");
> MUST : give a correct responce (here throw an exception);
The right thing is probably to document it. Throwing an exception is *not* necessarily the correct behavior, because this doesn't (have to) throw an exception: signed short i=60000;. Thus, this is not a bug, nor is it obvious that throwing an exception is desirable.