]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/type.h
Fix creating Symbols from arbitary types
[libs/datafile.git] / source / type.h
index 5a87a10222a84794341d9a167c94786ae022927f..242a9e11d1bed7c30cf8bbc978ff1b001133d74b 100644 (file)
@@ -17,7 +17,8 @@ struct Symbol
 {
        std::string name;
 
-       Symbol(const std::string &n): name(n) { }
+       template<typename T>
+       Symbol(const T &n): name(lexical_cast(n)) { }
 
        template<typename T> operator T() const { return lexical_cast<T>(name); }
 };