xtd 0.2.0
Loading...
Searching...
No Matches
placeholders.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "placeholder.hpp"
6
8namespace xtd {
10 namespace expressions {
41 template <size_t count>
42 struct placeholders {
43 template <size_t index>
44 constexpr auto get() const noexcept {
45 return placeholder<index + 1> {};
46 }
47 };
48 }
49}
50
52namespace std {
53 template <size_t count>
54 struct tuple_size<xtd::expressions::placeholders<count>> : std::integral_constant<size_t, count> {};
55
56 template <size_t index, size_t count>
57 struct tuple_element<index, xtd::expressions::placeholders<count>> {
58 using type = placeholder<index + 1>;
59 };
60}
61
62namespace xtd::expressions {
63 template <size_t index, size_t count>
64 constexpr auto get(xtd::expressions::placeholders<count> const& p) noexcept {
65 return p.template get<index>();
66 }
67}
std::type_info type
Stores information about a type.
Definition type.hpp:23
@ p
The P key.
Definition console_key.hpp:118
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::placeholder struct.
The xtd::expressions::placeholder object is placeholder for all expressions.
Definition placeholder.hpp:58
Generates a set of positional placeholders that can be decomposed using structured bindings to build ...
Definition placeholders.hpp:42