BioC++ core-0.7.0
The Modern C++ libraries for Bioinformatics.
 
Loading...
Searching...
No Matches
bio::alphabet::semialphabet Concept Reference

The basis for bio::alphabet::alphabet, but requires only rank interface (not char). More...

#include <bio/alphabet/concept.hpp>

Concept definition

template<typename t>
std::totally_ordered<t> && std::copy_constructible<t> && std::is_nothrow_copy_constructible_v<t> && requires(t v) {
{
bio::alphabet::size<t>
};
{
};
}
The basis for bio::alphabet::alphabet, but requires only rank interface (not char).
Definition: concept.hpp:562
constexpr auto to_rank
Return the rank representation of a (semi-)alphabet object.
Definition: concept.hpp:70

Detailed Description

The basis for bio::alphabet::alphabet, but requires only rank interface (not char).

This concept represents the "rank part" of what is considered "an alphabet" in BioC++. It requires no char representation and corresponding interfaces. It is mostly used internally.

Requirements

  1. t shall model std::totally_ordered ("has all comparison operators")
  2. objects of type t shall be efficiently copyable:
    • t shall model std::copy_constructible and be std::is_nothrow_copy_constructible
    • move construction shall not be more efficient than copy construction; this implies no dynamic memory (de-)allocation [this is a semantic requirement that cannot be checked]
  3. bio::alphabet::size needs to be defined for t
  4. bio::alphabet::to_rank needs to be defined for objects of type t

See the documentation pages for the respective requirements. The implications of 2. are that you can always take function arguments of types that model bio::alphabet::semialphabet by value.

It is highly recommended that non-reference types that model this concept, also model:

Almost all alphabets available in BioC++ do so.

Related types

If an object type t models this concept, the following types typically do so, as well:

  • t &
  • t const
  • t const &