SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
alphabet/nucleotide/concept.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
11#pragma once
12
13#include <concepts>
14
16
17// ============================================================================
18// complement()
19// ============================================================================
20
21namespace seqan3::detail::adl_only
22{
23
25template <typename... args_t>
26void complement(args_t...) = delete;
27
30struct complement_cpo : public detail::customisation_point_object<complement_cpo, 2>
31{
33 using base_t = detail::customisation_point_object<complement_cpo, 2>;
35 using base_t::base_t;
36
41 template <typename alphabet_t>
42 static constexpr auto SEQAN3_CPO_OVERLOAD(priority_tag<2>, alphabet_t && alphabet)(
43 /*return*/ seqan3::custom::alphabet<alphabet_t>::complement(std::forward<alphabet_t>(alphabet)) /*;*/
44 );
45
50 template <typename alphabet_t>
51 static constexpr auto SEQAN3_CPO_OVERLOAD(priority_tag<1>, alphabet_t && alphabet)(
52 /*return*/ complement(std::forward<alphabet_t>(alphabet)) /*;*/
53 );
54
59 template <typename alphabet_t>
60 static constexpr auto SEQAN3_CPO_OVERLOAD(priority_tag<0>, alphabet_t && alphabet)(
61 /*return*/ std::forward<alphabet_t>(alphabet).complement() /*;*/
62 );
63};
64
65} // namespace seqan3::detail::adl_only
66
67namespace seqan3
68{
69
108inline constexpr auto complement = detail::adl_only::complement_cpo{};
110
111// ============================================================================
112// nucleotide_alphabet concept
113// ============================================================================
114
143template <typename t>
144concept nucleotide_alphabet = alphabet<t> && requires (t val) {
145 {
147 };
148 };
150
151} // namespace seqan3
Core alphabet concept and free function/type trait wrappers.
#define SEQAN3_CPO_OVERLOAD(...)
A macro that helps to define a seqan3::detail::customisation_point_object.
Definition customisation_point.hpp:104
constexpr auto complement
Return the complement of a nucleotide object.
Definition alphabet/nucleotide/concept.hpp:102
The generic alphabet concept that covers most data types used in ranges.
A concept that indicates whether an alphabet represents nucleotides.
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
A type that can be specialised to provide customisation point implementations so that third party typ...
Definition alphabet/concept.hpp:46
Hide me