MCPcopy Create free account
hub / github.com/boostorg/parser / parse_real

Function parse_real

include/boost/parser/detail/numeric.hpp:1065–1088  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1063
1064 template<typename I, typename S, typename T>
1065 bool parse_real(I & first, S last, T & attr)
1066 {
1067 if constexpr (use_charconv_real<I, S>) {
1068#if defined(BOOST_PARSER_HAVE_CHARCONV)
1069 auto unpacked = text::unpack_iterator_and_sentinel(first, last);
1070#if defined(BOOST_PARSER_HAVE_STD_CHARCONV)
1071 std::from_chars_result const result = std::from_chars(
1072#else
1073 charconv::from_chars_result const result = charconv::from_chars(
1074#endif
1075 unpacked.first, unpacked.last, attr);
1076 if (result.ec == std::errc()) {
1077 first = unpacked.repack(result.ptr);
1078 return true;
1079 }
1080 return false;
1081#endif
1082 } else {
1083 detail_spirit_x3::real_policies<T> policies;
1084 using extract = detail_spirit_x3::
1085 extract_real<T, detail_spirit_x3::real_policies<T>>;
1086 return extract::parse(first, last, attr, policies);
1087 }
1088 }
1089 }
1090}
1091

Callers 1

callMethod · 0.85

Calls 2

parseFunction · 0.50

Tested by

no test coverage detected