tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
forward.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_UTILITY_FORWARD_HPP
4#define TETL_UTILITY_FORWARD_HPP
5
7
8namespace etl {
9
17template <typename T>
18constexpr auto forward(remove_reference_t<T>& param) noexcept -> T&&
19{
20 return static_cast<T&&>(param);
21}
22
23template <typename T>
24constexpr auto forward(remove_reference_t<T>&& param) noexcept -> T&&
25{
26 return static_cast<T&&>(param);
27}
28
29} // namespace etl
30
31#endif // TETL_UTILITY_FORWARD_HPP
typename remove_reference< T >::type remove_reference_t
Definition remove_reference.hpp:28
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