26 template <
typename method_t,
typename... args_t>
28 const char* name =
nullptr;
30 std::tuple<args_t...> args;
44 template <
typename method_t,
typename... args_t>
59 template <
typename method_t,
typename... args_t>
77 template <
typename expression_t,
typename method_t>
95 constexpr method_call_expression(expression_t expression, method_t method) : expression {std::move(expression)}, method {std::move(method)} {}
104 template <
typename... call_args_t>
105 constexpr decltype(
auto)
operator()(call_args_t&&... call_args)
const {
106 auto&& obj = expression(std::forward<call_args_t>(call_args)...);
107 auto invoke = [&](
auto&&... evaluated_args) ->
decltype(
auto) {
108 if constexpr (std::is_pointer_v<std::decay_t<
decltype(obj)>>)
return (obj->*method.method)(std::forward<decltype(evaluated_args)>(evaluated_args)...);
109 else return (obj.*method.method)(std::forward<decltype(evaluated_args)>(evaluated_args)...);
111 auto eval_arg = [&](
auto&& expr) ->
decltype(
auto) {
return expr(std::forward<call_args_t>(call_args)...);};
112 return std::apply([&](
auto&&... exprs) ->
decltype(
auto) {
return invoke(eval_arg(exprs)...);}, method.args);
119 std::apply([&os](
auto&&...
args) {
129 [[no_unique_address]] expression_t expression;
130 [[no_unique_address]] method_t method;
169 template <
typename expression_t,
typename method_t,
typename... stored_args_t>
209 template <
typename expression_t,
typename method_t,
typename... stored_args_t>
210 requires expression_operand<expression_t> || expression_operand<method_type<method_t, stored_args_t...>>
Contains xtd::expressions::as_expression methods.
The xtd::expressions::expression_operand object is expression operand concept.
Definition expression_operand.hpp:27
Contains xtd::expressions::expression_operand concept.
Contains xtd::expressions::expression_stream struct.
operator_precedence
Specifies the operator precedence.
Definition operator_precedence.hpp:22
constexpr auto operator|(expression_t expression, member_type< member_t > member)
Bind member operator.
Definition member_expression.hpp:191
constexpr decltype(auto) as_expression(type_t &&value)
The xtd::expressions::as_expression method convert a type as xtd::expressions::expression.
Definition as_expression.hpp:33
constexpr auto operator*(expression_t expression, member_type< member_t > member)
Bind member operator.
Definition member_expression.hpp:153
constexpr auto operator<<(left_t left, right_t right)
Subtract the specified left and right operands.
Definition left_shift_expression.hpp:127
constexpr auto method(method_t method, args_t &&... args)
The xtd::expressions::method is use to bind object method.
Definition method_call_expression.hpp:45
constexpr auto args()
Generates a set of positional placeholders that can be decomposed using structured bindings to build ...
Definition args.hpp:43
@ lowest
Represnets the lowest operator precedence.
Definition operator_precedence.hpp:152
@ method_access
Represnets the method access operator precedence (a.b a->b).
Definition operator_precedence.hpp:46
@ e
The E key.
Definition console_key.hpp:96
Contains xtd::expressions::invocation_expression struct.
The xtd::expressions namespace provides a lightweight, composable expression template framework for b...
Definition add_expression.hpp:14
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
read_only_span< type_t, count > first() const
Obtains a subspan consisting of the first count elements of the sequence.
Definition read_only_span.hpp:282
The xtd::expressions::expression_stream is the streamable class for expression objects.
Definition expression_stream.hpp:23
Provides the base class from which the classes that represent expression tree nodes are derived....
Definition expression.hpp:107
The xtd::expressions::as_expression method convert a type as xtd::expressions::expression or xtd::exp...
Definition method_call_expression.hpp:78
constexpr method_call_expression(expression_t expression, method_t method)
Initialize a new xtd::expressions::add_expression object with specified expression and method operand...
Definition method_call_expression.hpp:95
constexpr decltype(auto) operator()(call_args_t &&... call_args) const
Add the specified arguments.
Definition method_call_expression.hpp:105
static constexpr operator_precedence precedence
The operator precedence. That contains one of xtd::expressions::operator_precedence values.
Definition method_call_expression.hpp:83
constexpr method_call_expression()=default
Initialize a new xtd::expressions::method_call_expression object.
The xtd::expressions::method_type contains the method type.
Definition method_call_expression.hpp:27