Kind-of worked on the R-Tree; not really enough time to do much.
[aesalon.git] / include / util / StringTo.h
blob69af42dad2f8cea30c7babbd71045a073496e7c9
1 /** Aesalon, a tool to visualize program behaviour in real time.
2 Copyright (C) 2009-2011, Aesalon development team.
4 Aesalon is distributed under the terms of the GNU GPLv3. See
5 the included file LICENSE for more information.
7 @file include/util/StringTo.h
8 */
10 #ifndef AesalonUtil_StringTo_H
11 #define AesalonUtil_StringTo_H
13 #include <sstream>
15 namespace Util {
17 template<typename Type>
18 Type StringTo(const std::string &string) {
19 if(string == "") return Type();
20 std::istringstream ss(string);
21 Type t;
22 ss >> t;
23 return t;
26 } // namespace Util
28 #endif