From: Mikko Rasa Date: Mon, 15 Dec 2008 11:49:33 +0000 (+0000) Subject: Use lexical_cast instead of istringstream in Value::get X-Git-Tag: 1.1.1~1 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=9527722cbf433e25dcdf9210271af876a85910c7;p=libs%2Fdatafile.git Use lexical_cast instead of istringstream in Value::get --- diff --git a/source/value.h b/source/value.h index 4b3ac41..ace1894 100644 --- a/source/value.h +++ b/source/value.h @@ -69,14 +69,7 @@ inline T Value::get() const if(!check_type::type>(type)) throw TypeError("Type mismatch"); - std::istringstream ss(data); - T result; - ss>>result; - if(ss.fail()) - //XXX - throw Exception("Invalid value"); - - return result; + return lexical_cast(data); } template<>