SeqAn3  3.0.0
The Modern C++ library for sequence analysis.
detail.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2019, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2019, 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 
15 #include <type_traits>
16 
17 #include <seqan3/core/platform.hpp>
18 
19 namespace seqan3::detail
20 {
21 
22 // ------------------------------------------------------------------
23 // AlphabetTupleBase
24 // ------------------------------------------------------------------
25 
36 template <typename t>
38 SEQAN3_CONCEPT AlphabetTupleBase = requires
39 {
40  typename t::seqan3_tuple_components;
41  typename t::seqan3_recursive_tuple_components;
42 };
44 
45 // ------------------------------------------------------------------
46 // tuple_components
47 // ------------------------------------------------------------------
48 
53 template <typename t>
54 struct tuple_components;
55 
61 template <AlphabetTupleBase t>
62 struct tuple_components<t>
63 {
65  using type = typename t::seqan3_tuple_components;
66 };
67 
68 // ------------------------------------------------------------------
69 // recursive_tuple_components
70 // ------------------------------------------------------------------
71 
77 template <typename t>
78 struct recursive_tuple_components;
79 
85 template <AlphabetTupleBase t>
86 struct recursive_tuple_components<t>
87 {
89  using type = typename t::seqan3_recursive_tuple_components;
90 };
91 
92 // ------------------------------------------------------------------
93 // Callable concept helpers for meta::invoke
94 // ------------------------------------------------------------------
95 
99 template <typename T>
100 struct constructible_from
101 {
103  template <typename type>
105 };
106 
110 template <typename T>
111 struct implicitly_convertible_from
112 {
114  template <typename type>
116 };
117 
121 template <typename T>
122 struct assignable_from
123 {
125  template <typename type>
127 };
128 
132 template <typename T>
133 struct weakly_equality_comparable_with
134 {
136  template <typename type>
138 };
139 
143 template <typename T>
144 struct weakly_ordered_with
145 {
147  template <typename type>
149 };
150 
151 } // namespace seqan3::detail
152 
153 // ------------------------------------------------------------------
154 // Forwards
155 // ------------------------------------------------------------------
156 
157 namespace seqan3
158 {
159 
160 // forward
161 template <typename ...alternative_types>
163  requires (detail::WritableConstexprAlphabet<alternative_types> && ...) &&
164  (!std::is_reference_v<alternative_types> && ...) &&
165  (sizeof...(alternative_types) >= 2)
166  //TODO same char_type
168 class alphabet_variant;
169 
170 template <typename derived_type,
171  typename ...component_types>
173  requires (detail::WritableConstexprSemialphabet<component_types> && ...) &&
174  (!std::is_reference_v<component_types> && ...)
176 class alphabet_tuple_base;
177 
178 } // namespace seqan3
Provides platform and dependency checks.
The main SeqAn3 namespace.
T invoke(T... args)
Definition: aligned_sequence_concept.hpp:35