SeqAn3  3.0.1
The Modern C++ library for sequence analysis.
detail.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2020, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2020, 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 
19 
20 namespace seqan3::detail
21 {
22 
23 // ------------------------------------------------------------------
24 // alphabet_tuple_base_specialisation
25 // ------------------------------------------------------------------
26 
36 template <typename t>
38 SEQAN3_CONCEPT alphabet_tuple_base_specialisation = requires
39 {
40  requires t::seqan3_alphabet_tuple_base_specialisation;
41 };
43 
44 // ------------------------------------------------------------------
45 // required_types
46 // ------------------------------------------------------------------
47 
57 template <typename t>
58 struct required_types
59 {
61  using type = type_list<>;
62 };
63 
73 template <typename t>
75  requires requires { typename t::seqan3_required_types; }
77 struct required_types<t>
78 {
80  using type = typename t::seqan3_required_types;
81 };
82 
86 template <typename t>
87 using required_types_t = typename required_types<t>::type;
88 
89 // ------------------------------------------------------------------
90 // recursive_required_types
91 // ------------------------------------------------------------------
92 
93 //TODO: This can be replaced with metaprogramming magic once a few more functions land in list_traits.
94 
99 template <typename t>
100 struct recursive_required_types
101 {
103  using type = type_list<>;
104 };
105 
110 template <typename t>
112  requires requires
113  {
114  typename t::seqan3_recursive_required_types;
115  }
117 struct recursive_required_types<t>
118 {
120  using type = typename t::seqan3_recursive_required_types;
121 };
122 
126 template <typename t>
127 using recursive_required_types_t = typename recursive_required_types<t>::type;
128 
129 // ------------------------------------------------------------------
130 // Callable concept helpers for meta::invoke
131 // ------------------------------------------------------------------
132 
136 template <typename T>
137 struct constructible_from
138 {
140  template <typename type>
142 };
143 
147 template <typename T>
148 struct implicitly_convertible_from
149 {
151  template <typename type>
153 };
154 
158 template <typename T>
159 struct assignable_from
160 {
162  template <typename type>
164 };
165 
169 template <typename T>
170 struct weakly_equality_comparable_with_
171 {
173  template <typename type>
175 };
176 
180 template <typename T>
181 struct weakly_ordered_with_
182 {
184  template <typename type>
186 };
187 
188 } // namespace seqan3::detail
189 
190 // ------------------------------------------------------------------
191 // Forwards
192 // ------------------------------------------------------------------
193 
194 namespace seqan3
195 {
196 
197 // forward
198 template <typename ...alternative_types>
200  requires (detail::writable_constexpr_alphabet<alternative_types> && ...) &&
202  (sizeof...(alternative_types) >= 2)
203  //TODO same char_type
205 class alphabet_variant;
206 
207 template <typename derived_type,
208  typename ...component_types>
210  requires (detail::writable_constexpr_semialphabet<component_types> && ...) &&
213 class alphabet_tuple_base;
214 
215 } // namespace seqan3
std::integral_constant
constructible_from
The std::constructible_from concept specifies that a variable of type T can be initialized with the g...
std::invoke
T invoke(T... args)
core_language.hpp
Provides concepts for core language types and relations that don't have concepts in C++20 (yet).
seqan3
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:36
assignable_from
The concept std::assignable_from<LHS, RHS> specifies that an expression of the type and value categor...
regular
Subsumes std::semiregular and std::equality_comparable.
traits.hpp
Provides traits for seqan3::type_list.
lazy.hpp
Provides lazy template instantiation traits.
concept.hpp
Core alphabet concept and free function/type trait wrappers.