DryChem 1.0.0
A generic, compile-time C++ toolbox with no dependencies for the modern computational chemistry project.
Loading...
Searching...
No Matches
reverseList.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: reverseList.hpp
5// Author: crdrisko
6// Date: 01/10/2021-08:41:25
7// Description: A metafunction for reversing a compile-time list
8
9#ifndef DRYCHEM_COMMON_UTILITIES_INCLUDE_COMMON_UTILS_META_ALGORITHMS_REVERSELIST_HPP
10#define DRYCHEM_COMMON_UTILITIES_INCLUDE_COMMON_UTILS_META_ALGORITHMS_REVERSELIST_HPP
11
16
17namespace CppUtils::Meta
18{
26 template<typename List, bool Empty = is_empty_list_v<List>>
28
30 template<typename List>
32
39 template<typename List>
40 struct reverse_list<List, false> : public push_back_list<reverse_list_t<pop_front_list_t<List>>, front_list_t<List>>
41 {
42 };
43
50 template<typename List>
51 struct reverse_list<List, true>
52 {
53 using type = List;
54 };
55} // namespace CppUtils::Meta
56
57#endif
Definition frontList.hpp:13
typename reverse_list< List >::type reverse_list_t
Convenience variable template for ease-of-use.
Definition reverseList.hpp:31
Definition pushBackList.hpp:22
List type
Definition reverseList.hpp:53
Definition reverseList.hpp:27