]> git.tdb.fi Git - libs/datafile.git/commitdiff
Use lexical_cast instead of istringstream in Value::get
authorMikko Rasa <tdb@tdb.fi>
Mon, 15 Dec 2008 11:49:33 +0000 (11:49 +0000)
committerMikko Rasa <tdb@tdb.fi>
Mon, 15 Dec 2008 11:49:33 +0000 (11:49 +0000)
source/value.h

index 4b3ac4192b400f58388716d5baeaee7f243cb759..ace18945cbc2ea39eb4bc395cc116c0016b8e7e0 100644 (file)
@@ -69,14 +69,7 @@ inline T Value::get() const
        if(!check_type<TypeResolver<T>::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<T>(data);
 }
 
 template<>