SeqAn3  3.2.0-rc.1
The Modern C++ library for sequence analysis.
alphabet/composite/detail.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2022, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2022, Knut Reinert & MPI für molekulare Genetik
4 // This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5 // shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
6 // -----------------------------------------------------------------------------------------------------
7 
13 #pragma once
14 
20 
21 namespace seqan3::detail
22 {
23 
24 // ------------------------------------------------------------------
25 // alphabet_tuple_like
26 // ------------------------------------------------------------------
27 
38 template <typename t>
39 concept alphabet_tuple_like = requires { requires t::seqan3_alphabet_tuple_like; };
41 
42 // ------------------------------------------------------------------
43 // required_types
44 // ------------------------------------------------------------------
45 
55 template <typename t>
56 struct required_types
57 {
59  using type = type_list<>;
60 };
61 
71 template <typename t>
72  requires requires { typename t::seqan3_required_types; }
73 struct required_types<t>
74 {
76  using type = typename t::seqan3_required_types;
77 };
78 
82 template <typename t>
83 using required_types_t = typename required_types<t>::type;
84 
85 // ------------------------------------------------------------------
86 // recursive_required_types
87 // ------------------------------------------------------------------
88 
89 //TODO: This can be replaced with metaprogramming magic once a few more functions land in list_traits.
90 
95 template <typename t>
96 struct recursive_required_types
97 {
99  using type = type_list<>;
100 };
101 
106 template <typename t>
107  requires requires { typename t::seqan3_recursive_required_types; }
108 struct recursive_required_types<t>
109 {
111  using type = typename t::seqan3_recursive_required_types;
112 };
113 
117 template <typename t>
118 using recursive_required_types_t = typename recursive_required_types<t>::type;
119 
120 // ------------------------------------------------------------------
121 // Callable concept helpers for meta::invoke
122 // ------------------------------------------------------------------
123 
128 template <typename T>
129 struct constructible_from
130 {
132  template <typename type>
134 };
135 
140 template <typename T>
141 struct implicitly_convertible_from
142 {
144  template <typename type>
146 };
147 
152 template <typename T>
153 struct assignable_from
154 {
156  template <typename type>
158 };
159 
164 template <typename T>
165 struct weakly_equality_comparable_with_
166 {
168  template <typename type>
170 };
171 
176 template <typename T>
177 struct weakly_ordered_with_
178 {
180  template <typename type>
182 };
183 
184 // ------------------------------------------------------------------
185 // Concept traits helper
186 // ------------------------------------------------------------------
187 
191 template <typename lhs_t, typename rhs_t>
192 struct weakly_equality_comparable_with_trait :
193  std::integral_constant<bool, weakly_equality_comparable_with<lhs_t, rhs_t>>
194 {};
195 
199 template <typename lhs_t, typename rhs_t>
200 struct weakly_ordered_with_trait : std::integral_constant<bool, weakly_ordered_with<lhs_t, rhs_t>>
201 {};
202 
203 } // namespace seqan3::detail
204 
205 // ------------------------------------------------------------------
206 // Forwards
207 // ------------------------------------------------------------------
208 
209 namespace seqan3
210 {
211 
212 // forward
213 template <typename... alternative_types>
214  requires (detail::writable_constexpr_alphabet<alternative_types> && ...) && (std::regular<alternative_types> && ...)
215  && (sizeof...(alternative_types) >= 2)
216 class alphabet_variant;
217 
218 template <typename derived_type, typename... component_types>
219  requires (detail::writable_constexpr_semialphabet<component_types> && ...) && (std::regular<component_types> && ...)
220 class alphabet_tuple_base;
221 
222 } // namespace seqan3
Core alphabet concept and free function/type trait wrappers.
Provides alphabet helper concepts.
requires requires
The rank_type of the semi-alphabet; defined as the return type of seqan3::to_rank....
Definition: alphabet/concept.hpp:164
T invoke(T... args)
Provides lazy template instantiation traits.
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
Provides seqan3::type_list.
Provides concepts that do not have equivalents in C++20.