BioC++ core-0.7.0
The Modern C++ libraries for Bioinformatics.
 
Loading...
Searching...
No Matches
concept.hpp
Go to the documentation of this file.
1// -----------------------------------------------------------------------------------------------------
2// Copyright (c) 2022 deCODE Genetics
3// Copyright (c) 2006-2020, Knut Reinert & Freie Universität Berlin
4// Copyright (c) 2016-2020, Knut Reinert & MPI für molekulare Genetik
5// This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
6// shipped with this file and also available at: https://github.com/biocpp/biocpp-core/blob/main/LICENSE.md
7// -----------------------------------------------------------------------------------------------------
8
15#pragma once
16
17#include <type_traits>
18
21
22// ============================================================================
23// aminoacid_empty_base
24// ============================================================================
25
26namespace bio::alphabet
27{
28
34{};
35
36} // namespace bio::alphabet
37
38// ============================================================================
39// enable_aminoacid
40// ============================================================================
41
43{
44
69template <typename t>
70inline constexpr bool enable_aminoacid = std::derived_from<t, aminoacid_empty_base>;
71
72} // namespace bio::alphabet::custom
73
74namespace bio::alphabet
75{
76
77// ============================================================================
78// concept
79// ============================================================================
80
96template <typename type>
97concept aminoacid = alphabet<type> && custom::enable_aminoacid<std::remove_cvref_t<type>>;
98
99} // namespace bio::alphabet
Core alphabet concept and free function/type trait wrappers.
The generic alphabet concept that covers most data types used in ranges.
Definition: concept.hpp:643
A concept that indicates whether an alphabet represents amino acids.
Definition: concept.hpp:97
constexpr bool enable_aminoacid
A trait that indicates whether a type shall model bio::alphabet::aminoacid.
Definition: concept.hpp:70
A namespace for third party and standard library specialisations of BioC++ customisation points.
Definition: concept.hpp:43
The alphabet module's namespace.
Definition: aa10li.hpp:23
This is an empty base class that can be inherited by types that shall model bio::alphabet::aminoacid.
Definition: concept.hpp:34
Provides various traits to inspect templates.