tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
identity.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_FUNCTIONAL_IDENTITY_HPP
4#define TETL_FUNCTIONAL_IDENTITY_HPP
5
7
8namespace etl {
9
12struct identity {
13 using is_transparent = void;
14
15 template <typename T>
16 [[nodiscard]] constexpr auto operator()(T&& t) const noexcept -> T&&
17 {
18 return etl::forward<T>(t);
19 }
20};
21
22} // namespace etl
23
24#endif // TETL_FUNCTIONAL_IDENTITY_HPP
Definition adjacent_find.hpp:8
constexpr auto forward(remove_reference_t< T > &param) noexcept -> T &&
Forwards lvalues as either lvalues or as rvalues, depending on T. When t is a forwarding reference (a...
Definition forward.hpp:18
etl::identity is a function object type whose operator() returns its argument unchanged.
Definition identity.hpp:12
constexpr auto operator()(T &&t) const noexcept -> T &&
Definition identity.hpp:16
void is_transparent
Definition identity.hpp:13