SeqAn3 3.2.0
The Modern C++ library for sequence analysis.
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
21namespace seqan3::detail
22{
23
24// ------------------------------------------------------------------
25// alphabet_tuple_like
26// ------------------------------------------------------------------
27
38template <typename t>
39concept alphabet_tuple_like = requires { requires t::seqan3_alphabet_tuple_like; };
41
42// ------------------------------------------------------------------
43// required_types
44// ------------------------------------------------------------------
45
55template <typename t>
56struct required_types
57{
59 using type = type_list<>;
60};
61
71template <typename t>
72 requires requires { typename t::seqan3_required_types; }
73struct required_types<t>
74{
76 using type = typename t::seqan3_required_types;
77};
78
82template <typename t>
83using 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
95template <typename t>
96struct recursive_required_types
97{
99 using type = type_list<>;
100};
101
106template <typename t>
107 requires requires { typename t::seqan3_recursive_required_types; }
108struct recursive_required_types<t>
109{
111 using type = typename t::seqan3_recursive_required_types;
112};
113
117template <typename t>
118using recursive_required_types_t = typename recursive_required_types<t>::type;
119
120// ------------------------------------------------------------------
121// Callable concept helpers for meta::invoke
122// ------------------------------------------------------------------
123
128template <typename T>
129struct constructible_from
130{
132 template <typename type>
134};
135
140template <typename T>
141struct implicitly_convertible_from
142{
144 template <typename type>
146};
147
152template <typename T>
153struct assignable_from
154{
156 template <typename type>
158};
159
164template <typename T>
165struct weakly_equality_comparable_with_
166{
168 template <typename type>
170};
171
176template <typename T>
177struct weakly_ordered_with_
178{
180 template <typename type>
182};
183
184// ------------------------------------------------------------------
185// Concept traits helper
186// ------------------------------------------------------------------
187
191template <typename lhs_t, typename rhs_t>
192struct weakly_equality_comparable_with_trait :
193 std::integral_constant<bool, weakly_equality_comparable_with<lhs_t, rhs_t>>
194{};
195
199template <typename lhs_t, typename rhs_t>
200struct 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
209namespace seqan3
210{
211
212// forward
213template <typename... alternative_types>
214 requires (detail::writable_constexpr_alphabet<alternative_types> && ...) && (std::regular<alternative_types> && ...)
215 && (sizeof...(alternative_types) >= 2)
216class alphabet_variant;
217
218template <typename derived_type, typename... component_types>
219 requires (detail::writable_constexpr_semialphabet<component_types> && ...) && (std::regular<component_types> && ...)
220class alphabet_tuple_base;
221
222} // namespace seqan3
Core alphabet concept and free function/type trait wrappers.
Provides alphabet helper concepts.
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.