xtd 0.2.0
Loading...
Searching...
No Matches
value.hpp
Go to the documentation of this file.
1
4#pragma once
6#include <ostream>
7
9namespace xtd {
11 namespace expressions {
54 template <typename type_t>
55 struct value : value_expression {
57
62
64
68 constexpr value(type_t value) : value_ {std::move(value)} {}
70
72
76 template <typename... args_t>
77 constexpr auto operator()(args_t&&...) const {return value_;}
79
81 friend auto operator <<(std::ostream& os, value c) -> std::ostream& {return os << c.value_;}
83
84 private:
85 [[no_unique_address]] type_t value_;
86 };
87
89 template <typename type_t>
90 constexpr auto expression::value(type_t value) {return xtd::expressions::value {std::move(value)};}
92 }
93}
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
@ value
Represnets the constant operator precedence (42).
Definition operator_precedence.hpp:30
@ c
The C key.
Definition console_key.hpp:92
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
static constexpr auto value(type_t value)
Gets the value value.
The xtd::expressions::value is the value wrapper.
Definition value.hpp:55
static constexpr operator_precedence precedence
The operator precedence. That contains one of xtd::expressions::operator_precedence values.
Definition value.hpp:60
constexpr auto operator()(args_t &&...) const
Gets the value value.
Definition value.hpp:77
constexpr value(type_t value)
Initialize a new xtd::expressions::value object with specified value value.
Definition value.hpp:68
Contains xtd::expressions::value_expression struct.