xtd
1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
xtd.core
include
xtd
expressions
arg.hpp
Go to the documentation of this file.
1
4
#pragma once
5
#include "
operator_precedence.hpp
"
6
#include "
argument_expression.hpp
"
7
#include <concepts>
8
#include <ostream>
9
#include <tuple>
10
#include <type_traits>
11
13
namespace
xtd
{
15
namespace
expressions
{
30
template
<
size_t
index>
31
struct
argument : argument_expression {
33
36
static
constexpr
operator_precedence
precedence
=
operator_precedence::arg
;
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>
68
constexpr
argument<index>
arg
;
69
71
template
<
size_t
index>
72
const
argument<index>
expression::arg
;
73
74
template
<
size_t
index>
75
inline
auto
operator <<
(std::ostream& os,
const
argument<index>
&) -> std::ostream& {
return
os <<
"_"
<<
index
;}
77
}
78
}
argument_expression.hpp
Contains xtd::expressions::argument_expression struct.
xtd::expressions::operator<<
constexpr auto operator<<(left_t left, right_t right)
Subtract the specified left and right operands.
Definition
left_shift.hpp:127
xtd::expressions::operator_precedence
operator_precedence
Specifies the operator precedence.
Definition
operator_precedence.hpp:22
xtd::expressions::arg
constexpr argument< index > arg
Gets the index argument used by expression.
Definition
arg.hpp:68
xtd::expressions::operator_precedence::arg
@ arg
Represnets the arg operator precedence (_1).
Definition
operator_precedence.hpp:26
xtd::expressions
The xtd::expressions namespace provides a lightweight, composable expression template framework for b...
Definition
add.hpp:14
xtd
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition
abstract_object.hpp:8
operator_precedence.hpp
Contains xtd::expressions::operator_precedence enum class.
xtd::expressions::args
Generates a set of positional args that can be decomposed using structured bindings to build readable...
Definition
args.hpp:42
xtd::expressions::argument
The xtd::expressions::arg object is arg for all expressions.
Definition
arg.hpp:31
xtd::expressions::argument::operator()
constexpr auto operator()(args_t &&... args) const
Gets the arg value.
Definition
arg.hpp:51
xtd::expressions::argument::precedence
static constexpr operator_precedence precedence
The operator precedence. That contains one of xtd::expressions::operator_precedence values.
Definition
arg.hpp:36
xtd::expressions::expression::arg
static const xtd::expressions::argument< index > arg
Gets the index argument used by expression.
Definition
expression.hpp:95
xtd::index
Represents a type that can be used to index a collection either from the beginning or the end.
Definition
index.hpp:38
Generated on
for xtd by
Gammasoft
. All rights reserved.