SeqAn3  3.2.0-rc.1
The Modern C++ library for sequence analysis.
utility/concept.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 
15 #include <concepts>
16 #include <type_traits>
17 
18 #include <seqan3/core/platform.hpp>
19 
26 namespace seqan3
27 {
39 template <typename from, typename to>
40 concept implicitly_convertible_to = std::is_convertible_v<from, to>;
42 
54 template <typename from, typename to>
55 concept explicitly_convertible_to = requires { static_cast<to>(std::declval<from>()); };
57 
69 template <typename t>
70 concept arithmetic = std::is_arithmetic_v<t>;
72 
86 namespace deprecated
87 {
88 template <typename t>
89 concept floating_point = arithmetic<t> && std::is_floating_point_v<t>;
90 } // namespace deprecated
91 
92 template <typename t>
93 SEQAN3_DEPRECATED_330 constexpr bool floating_point = deprecated::floating_point<t>;
95 
107 
108 template <typename t>
109 concept builtin_character = std::integral<t>
110  && (std::same_as<t, char> || std::same_as<t, unsigned char> || std::same_as<t, signed char> ||
111 #ifdef __cpp_char8_t
112  std::same_as<t, char8_t> ||
113 #endif
114  std::same_as<t, char16_t> || std::same_as<t, char32_t> || std::same_as<t, wchar_t>);
116 
129 template <typename t>
130 concept trivially_destructible = std::destructible<t> && std::is_trivially_destructible_v<t>;
132 
145 template <typename t>
146 concept trivially_copyable = std::copyable<t> && std::is_trivially_copyable_v<t>;
148 
162 template <typename t>
163 concept trivial = trivially_copyable<t> && trivially_destructible<t> && std::is_trivial_v<t>;
165 
177 template <typename t>
178 concept standard_layout = std::is_standard_layout_v<t>;
180 
195 template <typename t, typename u>
196 concept weakly_assignable_from = std::is_assignable_v<t, u>;
198 } // namespace seqan3
The <concepts> header from C++20's standard library.
requires requires
The rank_type of the semi-alphabet; defined as the return type of seqan3::to_rank....
Definition: alphabet/concept.hpp:164
constexpr auto to(args_t &&... args)
Converts a range to a container.
Definition: range/to.hpp:114
A type that satisfies std::is_arithmetic_v<t>.
This concept encompasses exactly the types char, signed char, unsigned char, wchar_t,...
Checks whether from can be explicitly converted to to.
An alias for std::floating_point<t>.
Checks whether from can be implicityly converted to to.
Resolves to std::is_standard_layout_v<t>.
A type that satisfies seqan3::trivially_copyable and seqan3::trivially_destructible.
A type that satisfies std::is_trivially_copyable_v<t>.
A type that satisfies std::is_trivially_destructible_v<t>.
Resolves to std::is_assignable_v<t>.
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
Provides platform and dependency checks.
#define SEQAN3_DEPRECATED_330
Deprecation message for SeqAn 3.3.0 release.
Definition: platform.hpp:179