xtd 1.0.0
Loading...
Searching...
No Matches
arg.hpp
Go to the documentation of this file.
1
4#pragma once
7#include <concepts>
8#include <ostream>
9#include <tuple>
10#include <type_traits>
11
13namespace xtd {
15 namespace expressions {
30 template <size_t index>
31 struct argument : argument_expression {
33
38
40
42 argument() = default;
44
46
50 template<typename... args_t>
51 constexpr auto operator()(args_t&&... args) const {return std::get<index - 1>(std::forward_as_tuple(std::forward<args_t>(args)...));}
53 };
54
67 template <size_t index>
69
71 template <size_t index>
73
74 template <size_t index>
75 inline auto operator <<(std::ostream& os, const argument<index>&) -> std::ostream& {return os << "_" << index;}
77 }
78}
Contains xtd::expressions::argument_expression 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 argument< index > arg
Gets the index argument used by expression.
Definition arg.hpp:68
@ arg
Represnets the arg operator precedence (_1).
Definition operator_precedence.hpp:26
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
Contains xtd::expressions::operator_precedence enum class.
Generates a set of positional args that can be decomposed using structured bindings to build readable...
Definition args.hpp:42
The xtd::expressions::arg object is arg for all expressions.
Definition arg.hpp:31
constexpr auto operator()(args_t &&... args) const
Gets the arg value.
Definition arg.hpp:51
static constexpr operator_precedence precedence
The operator precedence. That contains one of xtd::expressions::operator_precedence values.
Definition arg.hpp:36
static const xtd::expressions::argument< index > arg
Gets the index argument used by expression.
Definition expression.hpp:95
Represents a type that can be used to index a collection either from the beginning or the end.
Definition index.hpp:38