MCPcopy Create free account
hub / github.com/boostorg/parser / operator()

Method operator()

include/boost/parser/parser.hpp:2875–2907  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2873 {
2874 template<typename T, typename U>
2875 constexpr auto operator()(T result, U x) const
2876 {
2877 using struct_elem =
2878 remove_cv_ref_t<decltype(parser::get(x, llong<0>{}))>;
2879 using tuple_elem =
2880 remove_cv_ref_t<decltype(parser::get(x, llong<1>{}))>;
2881 if constexpr (!T::value) {
2882 return std::false_type{};
2883 } else if constexpr (
2884 is_optional_v<struct_elem> && is_optional_v<tuple_elem>) {
2885 using struct_opt_type = optional_type<struct_elem>;
2886 using tuple_opt_type = optional_type<tuple_elem>;
2887 using retval_t = decltype((*this)(
2888 result,
2889 detail::hl::make_tuple(
2890 std::declval<struct_opt_type &>(),
2891 std::declval<tuple_opt_type &>())));
2892 return retval_t{};
2893 } else if constexpr (std::is_convertible_v<
2894 tuple_elem &&,
2895 struct_elem>) {
2896 return std::true_type{};
2897 } else if constexpr (
2898 container<struct_elem> && container<tuple_elem>) {
2899 return detail::is_struct_compatible<
2900 range_value_t<struct_elem>,
2901 range_value_t<tuple_elem>>();
2902 } else {
2903 return std::bool_constant<detail::is_struct_compatible<
2904 struct_elem,
2905 tuple_elem>()>{};
2906 }
2907 }
2908 };
2909
2910 template<typename T, typename U>

Callers

nothing calls this directly

Calls 2

make_tupleFunction · 0.85
getFunction · 0.70

Tested by

no test coverage detected