SeqAn3  3.0.1
The Modern C++ library for sequence analysis.
basic.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 
15 #include <tuple>
16 #include <type_traits>
17 
19 
20 namespace seqan3
21 {
22 
27 // ----------------------------------------------------------------------------
28 // remove_cvref_t
29 // ----------------------------------------------------------------------------
30 
34 template <typename t>
36 
37 // ----------------------------------------------------------------------------
38 // remove_rvalue_reference
39 // ----------------------------------------------------------------------------
40 
46 template <typename t>
48 {
51 };
52 
57 template <typename t>
59 
60 // ----------------------------------------------------------------------------
61 // is_constexpr_default_constructible
62 // ----------------------------------------------------------------------------
63 
68 template <typename t>
70 {};
71 
76 template <typename t>
78  requires std::is_default_constructible_v<t>
80 struct is_constexpr_default_constructible<t> : std::integral_constant<bool, SEQAN3_IS_CONSTEXPR(t{})>
81 {};
82 
87 template <typename t>
88 inline constexpr bool is_constexpr_default_constructible_v = is_constexpr_default_constructible<t>::value;
89 
91 } // namespace seqan3
92 
93 namespace seqan3::detail
94 {
95 
100 // ----------------------------------------------------------------------------
101 // deferred_type
102 // ----------------------------------------------------------------------------
103 
110 template <typename t, typename ...dependent_ts>
111 struct deferred_type
112 {
114  using type = t;
115 };
116 
123 template <typename t, typename ...dependent_ts>
124 using deferred_type_t = typename deferred_type<t, dependent_ts...>::type;
125 
126 // ----------------------------------------------------------------------------
127 // remove_cvref_t
128 // ----------------------------------------------------------------------------
129 
131 using ignore_t = remove_cvref_t<decltype(std::ignore)>;
132 
137 template <typename t>
138 constexpr bool decays_to_ignore_v = std::is_same_v<remove_cvref_t<t>, ignore_t>;
139 
141 
142 } // namespace seqan3::detail
143 
144 // ----------------------------------------------------------------------------
145 // SEQAN3_IS_SAME
146 // ----------------------------------------------------------------------------
147 
152 #if defined(__clang__)
153 # define SEQAN3_IS_SAME(...) __is_same(__VA_ARGS__)
154 #elif defined(__GNUC__)
155 # define SEQAN3_IS_SAME(...) __is_same_as(__VA_ARGS__)
156 #else
157 # define SEQAN3_IS_SAME(...) std::is_same_v<__VA_ARGS__>
158 #endif
function.hpp
Provides various type traits for use on functions.
seqan3::remove_cvref_t
std::remove_cv_t< std::remove_reference_t< t > > remove_cvref_t
Return the input type with const, volatile and references removed (type trait).
Definition: basic.hpp:35
std::false_type
tuple
seqan3::remove_rvalue_reference
Return the input type with && removed, but lvalue references preserved.
Definition: basic.hpp:47
seqan3::remove_rvalue_reference_t
typename remove_rvalue_reference< t >::type remove_rvalue_reference_t
Return the input type with && removed, but lvalue references preserved (transformation_trait shortcut...
Definition: basic.hpp:58
seqan3
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:36
std::remove_reference_t
std::remove_cv_t
std::conditional_t
seqan3::is_constexpr_default_constructible
Whether a type std::is_default_constructible in constexpr-context.
Definition: basic.hpp:69