#include "Utils.hpp" #include #include #include using namespace std; int main(int argc, char **argv) { string const sFloat = "3.1415926"; string const sInt = "3"; string const sLong = "123456789123456789"; double const a = Utils::stodWithDefault(sFloat, 0.0); int const b = Utils::stoiWithDefault(sInt, 0); long const c = Utils::stolWithDefault(sLong, 0); string const strA = to_string(a); string const strB = to_string(b); string const strC = to_string(c); cout << fmt::format("sFloat as double: {0:f}", a) << endl; cout << fmt::format("sInt as int: {0:d}", b) << endl; cout << fmt::format("sLong as long: {0:d}", c) << endl; cout << fmt::format("a as string: {0:s}", strA) << endl; cout << fmt::format("b as string: {0:s}", strB) << endl; cout << fmt::format("c as string: {0:s}", strC) << endl; return 0; }