SeqAn3
3.4.0
The Modern C++ library for sequence analysis.
Toggle main menu visibility
Loading...
Searching...
No Matches
basic.hpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
2
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
3
// SPDX-License-Identifier: BSD-3-Clause
4
9
10
#pragma once
11
12
#include <
tuple
>
13
#include <
type_traits
>
14
15
#include <
seqan3/core/platform.hpp
>
16
17
// ----------------------------------------------------------------------------
18
// is_constexpr
19
// ----------------------------------------------------------------------------
20
22
26
#if defined(__clang__)
// https://github.com/llvm/llvm-project/issues/58078
27
# define SEQAN3_IS_CONSTEXPR(...) true
28
#else
29
# define SEQAN3_IS_CONSTEXPR(...) std::integral_constant<bool, __builtin_constant_p(((void)__VA_ARGS__, 0))>::value
30
#endif
32
33
namespace
seqan3
34
{
35
36
// ----------------------------------------------------------------------------
37
// remove_rvalue_reference
38
// ----------------------------------------------------------------------------
39
46
template
<
typename
t>
47
struct
remove_rvalue_reference
48
{
50
using
type
=
std::conditional_t<std::is_rvalue_reference_v<t>
,
std::remove_reference_t<t>
, t>;
51
};
52
58
template
<
typename
t>
59
using
remove_rvalue_reference_t
=
typename
remove_rvalue_reference<t>::type
;
60
61
// ----------------------------------------------------------------------------
62
// is_constexpr_default_constructible
63
// ----------------------------------------------------------------------------
64
70
template
<
typename
t>
71
struct
is_constexpr_default_constructible
:
std::false_type
72
{};
73
75
template
<
typename
t>
76
requires
std::is_default_constructible_v<t>
77
struct
is_constexpr_default_constructible
<t> :
std::integral_constant
<bool, SEQAN3_IS_CONSTEXPR(t{})>
78
{};
80
85
template
<
typename
t>
86
inline
constexpr
bool
is_constexpr_default_constructible_v
=
is_constexpr_default_constructible<t>::value
;
87
88
}
// namespace seqan3
89
90
namespace
seqan3::detail
91
{
92
93
// ----------------------------------------------------------------------------
94
// deferred_type
95
// ----------------------------------------------------------------------------
96
104
template
<
typename
t,
typename
... dependent_ts>
105
struct
deferred_type
106
{
108
using
type = t;
109
};
110
118
template
<
typename
t,
typename
... dependent_ts>
119
using
deferred_type_t =
typename
deferred_type<t, dependent_ts...>::type;
120
121
// ----------------------------------------------------------------------------
122
// ignore_t
123
// ----------------------------------------------------------------------------
124
127
using
ignore_t = std::remove_cvref_t<
decltype
(std::ignore)>;
128
134
template
<
typename
t>
135
constexpr
bool
decays_to_ignore_v =
std::is_same_v<std::remove_cvref_t<t>
, ignore_t>;
136
137
}
// namespace seqan3::detail
138
139
// ----------------------------------------------------------------------------
140
// SEQAN3_IS_SAME
141
// ----------------------------------------------------------------------------
142
144
148
#if defined(__clang__)
149
# define SEQAN3_IS_SAME(...) __is_same(__VA_ARGS__)
150
#elif defined(__GNUC__)
151
# define SEQAN3_IS_SAME(...) __is_same_as(__VA_ARGS__)
152
#else
153
# define SEQAN3_IS_SAME(...) std::is_same_v<__VA_ARGS__>
154
#endif
std::conditional_t
std::false_type
std::is_default_constructible_v
T is_default_constructible_v
std::is_same_v
T is_same_v
seqan3
The main SeqAn3 namespace.
Definition
aligned_sequence_concept.hpp:26
platform.hpp
Provides platform and dependency checks.
std::remove_reference_t
seqan3::is_constexpr_default_constructible
Whether a type std::is_default_constructible in constexpr-context (unary_type_trait specialisation).
Definition
basic.hpp:72
seqan3::is_constexpr_default_constructible::is_constexpr_default_constructible_v
constexpr bool is_constexpr_default_constructible_v
Whether a type std::is_default_constructible in constexpr-context (unary_type_trait shortcut).
Definition
basic.hpp:86
seqan3::remove_rvalue_reference
Return the input type with && removed, but lvalue references preserved.
Definition
basic.hpp:48
seqan3::remove_rvalue_reference::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:59
seqan3::remove_rvalue_reference::type
std::conditional_t< std::is_rvalue_reference_v< t >, std::remove_reference_t< t >, t > type
The return type is the input type with any && stripped.
Definition
basic.hpp:50
tuple
type_traits
Hide me
Version:
seqan3
utility
type_traits
basic.hpp
Generated on
for SeqAn3 by
1.17.0