SeqAn3 3.2.0
The Modern C++ library for sequence analysis.
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
19
26namespace seqan3
27{
39template <typename from, typename to>
40concept implicitly_convertible_to = std::is_convertible_v<from, to>;
42
54template <typename from, typename to>
55concept explicitly_convertible_to = requires { static_cast<to>(std::declval<from>()); };
57
69template <typename t>
70concept arithmetic = std::is_arithmetic_v<t>;
72
86namespace deprecated
87{
88template <typename t>
89concept floating_point = arithmetic<t> && std::is_floating_point_v<t>;
90} // namespace deprecated
91
92template <typename t>
93SEQAN3_DEPRECATED_330 constexpr bool floating_point = deprecated::floating_point<t>;
95
107
108template <typename t>
109concept 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
129template <typename t>
130concept trivially_destructible = std::destructible<t> && std::is_trivially_destructible_v<t>;
132
145template <typename t>
146concept trivially_copyable = std::copyable<t> && std::is_trivially_copyable_v<t>;
148
162template <typename t>
163concept trivial = trivially_copyable<t> && trivially_destructible<t> && std::is_trivial_v<t>;
165
177template <typename t>
178concept standard_layout = std::is_standard_layout_v<t>;
180
195template <typename t, typename u>
196concept weakly_assignable_from = std::is_assignable_v<t, u>;
198} // namespace seqan3
constexpr auto to(args_t &&... args)
Converts a range to a container.
Definition: 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