#undef NDEBUG #include "Utils.hpp" #include #include #include using namespace Utils; using namespace std; int main(int argc, char **argv) { string const S_FLOAT = "3.1415926"; string const S_INT = "3"; string const S_LONG = "123456789123456789"; double const a = Utils::stodWithDefault(S_FLOAT, 0.0); int const b = Utils::stoiWithDefault(S_INT, 0); long const c = Utils::stolWithDefault(S_LONG, 0); string const STR_A = to_string(a); string const STR_B = to_string(b); string const STR_C = 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}", STR_A) << endl; cout << fmt::format("b as string: {0:s}", STR_B) << endl; cout << fmt::format("c as string: {0:s}", STR_C) << endl; return 0; }