DryChem 1.0.0
A generic, compile-time C++ toolbox with no dependencies for the modern computational chemistry project.
Loading...
Searching...
No Matches
select.hpp
Go to the documentation of this file.
1// Copyright (c) 2020-2025 Cody R. Drisko. All rights reserved.
2// Licensed under the MIT License. See the LICENSE file in the project root for more information.
3//
4// Name: select.hpp
5// Author: crdrisko
6// Date: 11/21/2020-06:52:54
7// Description: An algorithm to select the appropriate elements of a given tuple
8
9#ifndef DRYCHEM_COMMON_UTILITIES_INCLUDE_COMMON_UTILS_META_TYPES_TUPLES_TUPLEALGORITHMS_SELECT_HPP
10#define DRYCHEM_COMMON_UTILITIES_INCLUDE_COMMON_UTILS_META_TYPES_TUPLES_TUPLEALGORITHMS_SELECT_HPP
11
12#include <cstddef>
13#include <tuple>
14#include <utility>
15
16namespace CppUtils::Meta
17{
26 template<typename... Elements, std::size_t... Indices>
27 constexpr auto select(const std::tuple<Elements...>& tuple, std::index_sequence<Indices...>)
28 {
29 return std::make_tuple(std::get<Indices>(tuple)...);
30 }
31} // namespace CppUtils::Meta
32
33#endif
Definition frontList.hpp:13
constexpr auto select(const std::tuple< Elements... > &tuple, std::index_sequence< Indices... >)
Definition select.hpp:27