libscstring/generics.hpp
Bob Polis ea9bcb2fee Added from_string; added remove_accents
This adds a dependency on libunistring.
2021-07-02 11:30:13 +02:00

20 lines
298 B
C++

#ifndef GENERICS_H_
#define GENERICS_H_
#include <string>
#include <sstream>
namespace sc {
template<typename T>
T from_string(const std::string& val) {
T result;
std::istringstream iss {val};
iss >> result;
return result;
}
}
#endif // GENERICS_H_