elements.hpp
Go to the documentation of this file.
1 // Copyright 2022-2023 Ekumen, Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef BELUGA_VIEWS_ELEMENTS_HPP
16 #define BELUGA_VIEWS_ELEMENTS_HPP
17 
18 #include <tuple>
19 
20 #include <range/v3/view/transform.hpp>
21 
27 namespace beluga::views {
28 
31 
35 template <std::size_t N>
36 inline constexpr auto elements = ranges::views::transform(
37  [](auto&& tuple) -> decltype(auto) { return std::get<N>(std::forward<decltype(tuple)>(tuple)); });
38 
39 } // namespace beluga::views
40 
41 #endif
beluga::views
Definition: elements.hpp:27
beluga::views::elements
constexpr auto elements
Definition: elements.hpp:36


beluga
Author(s):
autogenerated on Tue Jul 16 2024 02:59:53