[#if_] [section if_] [h1 Synopsis] template struct if_; This is a [link parser_combinator parser combinator]. [table Arguments [[Name] [Type]] [[`P`] [[link parser parser]]] [[`T`] [[link metaprogramming_value template metaprogramming value]]] [[`F`] [[link metaprogramming_value template metaprogramming value]]] ] [h1 Description] `if_` always accepts the input string. The result of parsing is `T`, when `P` accepts the input and `F` otherwise. [h1 Header] #include [h1 Expression semantics] For any `p` parser, `t` and `f` classes the following are equivalent: if_ one_of>, return_> [h1 Example] #include #include #include #include #include #include using namespace boost::metaparse; using int11 = std::integral_constant; using int13 = std::integral_constant; static_assert( get_result< if_::apply >::type::value == 11, "When the int_ parser succeeds, the result of parsing should be 11" ); static_assert( get_result< if_::apply >::type::value == 13, "When the int_ parser fails, the result of parsing should be 13" ); [endsect]