|
Boost : |
From: Daryle Walker (darylew_at_[hidden])
Date: 2001-09-27 18:12:40
on 9/27/01 8:46 AM, Robin at darkaurora_at_[hidden] wrote:
[SNIP]
> Also, throwing an exception when a lexical_cast fails is not always
> ideal. Why not overload it to return a return code? Something like
>
>
> template <typename Target, typename Source>
> bool lexical_cast( Target &target, const Source &src )
> {
> std::stringstream ss;
>
> if ( !( ss << src) || !( ss >> target) || !( ss >> std::ws).eof() )
> {
> return false;
> }
> return true;
> }
But then it wouldn't look like the other C++ casts.
> PS:I found a similiar discussion Nov 2000 but the issue seems
> unresolved. So what is the status?
-- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk