Add the target type to lexical_cast invocations
authorMikko Rasa <tdb@tdb.fi>
Sat, 1 Dec 2012 09:32:19 +0000 (11:32 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 1 Dec 2012 09:32:19 +0000 (11:32 +0200)
source/textwriter.cpp
source/type.h

index 5212c97..c870ba0 100644 (file)
@@ -37,7 +37,7 @@ void TextWriter::write_(const Statement &st, unsigned level)
                else if(i->get_signature()==BoolType::signature)
                        out.write(i->get<BoolType::Store>() ? "true" : "false");
                else if(i->get_signature()==IntType::signature)
-                       out.write(lexical_cast(i->get<IntType::Store>()));
+                       out.write(lexical_cast<string>(i->get<IntType::Store>()));
                else if(i->get_signature()==FloatType::signature)
                        out.write(format(float_format, i->get<FloatType::Store>()));
                else if(i->get_signature()==SymbolType::signature)
index 85cfec4..17545ba 100644 (file)
@@ -12,7 +12,7 @@ struct Symbol
        std::string name;
 
        template<typename T>
-       Symbol(const T &n): name(lexical_cast(n)) { }
+       Symbol(const T &n): name(lexical_cast<std::string>(n)) { }
 
        template<typename T> operator T() const { return lexical_cast<T>(name); }
 };