• Home
  • Raw
  • Download

Lines Matching refs:convert

39 using boost::convert;
56 int i2 = convert<int>("123").value(); // boost::convert with the default converter in getting_started_example1()
57 int i3 = convert<int>("123", cnv).value(); // boost::convert with an explicit converter in getting_started_example1()
59 string s2 = convert<string>(123).value(); // boost::convert with the default converter in getting_started_example1()
60 string s3 = convert<string>(123, cnv).value(); // boost::convert with an explicit converter in getting_started_example1()
85 int i = convert<int>("uhm", boost::cnv::lexical_cast()).value_or(-1); in getting_started_example2()
105 int i1 = convert<int>("123", cnv1).value(); in getting_started_example3()
106 int i2 = convert<int>("123", cnv2).value(); // Two times faster than lexical_cast. in getting_started_example3()
107 int i3 = convert<int>("123", cnv3).value(); // Four times faster than lexical_cast. in getting_started_example3()
129 int i2 = convert<int>(" 123", cnv(std::skipws)).value(); // Success in getting_started_example4()
131 string s2 = convert<string>(12.34567, cnv(std::fixed)(std::setprecision(3))).value(); in getting_started_example4()
132 string s3 = convert<string>(12.34567, cnv(std::scientific)(std::setprecision(3))).value(); in getting_started_example4()
150 int i2 = convert<int>("123", cnv).value(); // Throws when conversion fails. in getting_started_example5()
151 int i3 = convert<int>("uhm", cnv).value_or(-1); // Returns -1 when conversion fails. in getting_started_example5()
171 int i1 = convert<int>(s1, cnv(std::hex)).value_or(-1); // Read as hex in getting_started_example6()
172 int i2 = convert<int>(s2, cnv(std::dec)).value_or(-1); // Read as decimal in getting_started_example6()
195 …int i1 = convert<int>(s1, cnv(std::hex)).value_or(default_i1); // If failed, proceed with the defa… in getting_started_example7()
196 …int i2 = convert<int>(s2, cnv(std::dec)).value_or(default_i2); // If failed, proceed with the defa… in getting_started_example7()
225 int i1 = convert<int>(s1).value_or_eval(boost::bind(fallback_fun, "bad i1", default_i1)); in getting_started_example9()
226 int i2 = convert<int>(s2).value_or_eval(boost::bind(fallback_fun, "bad i2", default_i2)); in getting_started_example9()