BioC++ core-0.7.0
The Modern C++ libraries for Bioinformatics.
 
Loading...
Searching...
No Matches
hash.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
14#pragma once
15
17
18namespace std
19{
24template <typename alphabet_t>
26struct hash<alphabet_t>
27{
34 size_t operator()(alphabet_t const character) const noexcept { return bio::alphabet::to_rank(character); }
35};
36
37} // namespace std
Core alphabet concept and free function/type trait wrappers.
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
size_t operator()(alphabet_t const character) const noexcept
Compute the hash for a character.
Definition: hash.hpp:34