29 template <
typename condition_t,
typename then_t,
typename else_t>
48 constexpr if_then_else_expression(condition_t condition, then_t then_, else_t else_) : condition(std::move(condition)), then_(std::move(then_)), else_(std::move(else_)) {}
57 template <
typename... args_t>
66 [[no_unique_address]] condition_t condition;
67 [[no_unique_address]] then_t then_;
68 [[no_unique_address]] else_t else_;
90 template <
typename condition_t,
typename then_t,
typename else_t>
92 constexpr auto if_then_else(condition_t condition, then_t then_, else_t else_) {
96 return if_then_else_expression<std::decay_t<
decltype(condition_expression)>, std::decay_t<
decltype(then_expression)>, std::decay_t<
decltype(else_expression)>> {std::move(condition_expression), std::move(then_expression), std::move(else_expression)};
Contains xtd::expressions::as_expression methods.
The xtd::expressions::expression_operand object is expression operand concept.
Definition expression_operand.hpp:27
Contains xtd::expressions::conditional_expression struct.
Contains xtd::expressions::expression_operand concept.
Contains xtd::expressions::expression_stream struct.
constexpr auto operator<<(left_t left, right_t right)
Subtract the specified left and right operands.
Definition left_shift.hpp:127
operator_precedence
Specifies the operator precedence.
Definition operator_precedence.hpp:22
constexpr auto if_then_else(condition_t condition, then_t then_, else_t else_)
If condition is true return then_ else retur nelse_.
Definition if_then_else_expression.hpp:92
@ ternary
Represnets the ternary operator precedence (a ? a : c).
Definition operator_precedence.hpp:120
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
@ e
The E key.
Definition console_key.hpp:96
The xtd::expressions namespace provides a lightweight, composable expression template framework for b...
Definition add.hpp:14
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Generates a set of positional args that can be decomposed using structured bindings to build readable...
Definition args.hpp:42
The xtd::expressions::expression_stream is the streamable class for expression objects.
Definition expression_stream.hpp:23
The xtd::expressions::if_then_else_expression is the addition expression.
Definition if_then_else_expression.hpp:30
static constexpr operator_precedence precedence
The operator precedence. That contains one of xtd::expressions::operator_precedence values.
Definition if_then_else_expression.hpp:35
constexpr auto operator()(args_t &&... args) const
Equal to the specified arguments.
Definition if_then_else_expression.hpp:58
constexpr if_then_else_expression()=default
Initialize a new xtd::expressions::if_then_else_expression object.
constexpr if_then_else_expression(condition_t condition, then_t then_, else_t else_)
Initialize a new xtd::expressions::logical_or_expression object with specified left and right operand...
Definition if_then_else_expression.hpp:48