tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
forward_as_tuple.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2021 Tobias Hienzsch
3
4#ifndef TETL_TUPLE_FORWARD_AS_TUPLE_HPP
5#define TETL_TUPLE_FORWARD_AS_TUPLE_HPP
6
7#include <etl/_tuple/tuple.hpp>
8#include <etl/_utility/forward.hpp>
9
10namespace etl {
11
12/// \brief Constructs a tuple of references to the arguments in args suitable
13/// for forwarding as an argument to a function. The tuple has rvalue reference
14/// data members when rvalues are used as arguments, and otherwise has lvalue
15/// reference data members.
16template <typename... Args>
17[[nodiscard]] constexpr auto forward_as_tuple(Args&&... args) noexcept -> etl::tuple<Args&&...>
18{
19 return etl::tuple<Args&&...>{etl::forward<Args>(args)...};
20}
21
22} // namespace etl
23
24#endif // TETL_TUPLE_FORWARD_AS_TUPLE_HPP
Definition adjacent_find.hpp:9
constexpr auto forward_as_tuple(Args &&... args) noexcept -> etl::tuple< Args &&... >
Constructs a tuple of references to the arguments in args suitable for forwarding as an argument to a...
Definition forward_as_tuple.hpp:17
Definition tuple.hpp:114