xtd 0.2.0
Loading...
Searching...
No Matches
placeholder.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 {
57 template <size_t index>
58 struct placeholder : placeholder_expression {
60
65
67
69 placeholder() = default;
71
73
77 template <typename... args_t>
78 constexpr decltype(auto) operator()(args_t&&... args) const {
79 return std::get<index - 1>(std::forward_as_tuple(std::forward<args_t>(args)...));
80 }
81
82 };
83
85 template <size_t index>
87
88 template <size_t index>
89 inline auto operator <<(std::ostream& os, const placeholder<index>&) -> std::ostream& {return os << "_" << index;}
91 }
92}
operator_precedence
Specifies the operator precedence.
Definition operator_precedence.hpp:22
constexpr auto operator<<(left_t left, right_t right)
Subtract the specified left and right operands.
Definition left_shift_expression.hpp:127
constexpr auto args()
Generates a set of positional placeholders that can be decomposed using structured bindings to build ...
Definition args.hpp:43
@ placeholder
Represnets the placeholder operator precedence (_1).
Definition operator_precedence.hpp:26
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
Contains xtd::expressions::operator_precedence enum class.
Contains xtd::expressions::placeholder_expression struct.
static constexpr auto placeholder()
Gets the index placeholder used by expression.
The xtd::expressions::placeholder object is placeholder for all expressions.
Definition placeholder.hpp:58
static constexpr operator_precedence precedence
The operator precedence. That contains one of xtd::expressions::operator_precedence values.
Definition placeholder.hpp:63