SeqAn3 3.3.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
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
84
85template <typename t>
86concept builtin_character = std::integral<t>
87 && (std::same_as<t, char> || std::same_as<t, unsigned char> || std::same_as<t, signed char> ||
88#ifdef __cpp_char8_t
89 std::same_as<t, char8_t> ||
90#endif
91 std::same_as<t, char16_t> || std::same_as<t, char32_t> || std::same_as<t, wchar_t>);
93
106template <typename t>
107concept trivially_destructible = std::destructible<t> && std::is_trivially_destructible_v<t>;
109
122template <typename t>
123concept trivially_copyable = std::copyable<t> && std::is_trivially_copyable_v<t>;
125
139template <typename t>
140concept trivial = trivially_copyable<t> && trivially_destructible<t> && std::is_trivial_v<t>;
142
154template <typename t>
155concept standard_layout = std::is_standard_layout_v<t>;
157
172template <typename t, typename u>
173concept weakly_assignable_from = std::is_assignable_v<t, u>;
175} // 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.
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.