2 #include "android_cpp11_compat.h"
6 void from_string(const std::string& s, T& result) {
7 std::stringstream ss(s);
8 ss >> result; // TODO handle errors
14 int stoi(const string& s)
18 OC::from_string(s, ref);
22 double stod(const std::string& s)
26 OC::from_string(s, ref);
30 long long stoll(const std::string& s)
33 long long int &ref = ret;
34 OC::from_string(s, ref);
38 unsigned long long stoull(const std::string& s)
40 unsigned long long ret;
41 unsigned long long &ref = ret;
42 OC::from_string(s, ref);
46 long double stold(const string& s)
49 long double &ref = ret;
50 OC::from_string(s, ref);
54 std::string to_string(int t) {
55 std::ostringstream os;
60 std::string to_string(double t) {
61 std::ostringstream os;
66 std::string to_string(uint32_t t)
68 std::ostringstream os;