SeqAn3  3.0.3
The Modern C++ library for sequence analysis.
hash.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2021, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2021, 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 
16 
17 namespace std
18 {
25 template <typename alphabet_t>
29 struct hash<alphabet_t>
30 {
39  size_t operator()(alphabet_t const character) const noexcept
40  {
41  return seqan3::to_rank(character);
42  }
43 };
44 
45 } // namespace std
Core alphabet concept and free function/type trait wrappers.
constexpr auto to_rank
Return the rank representation of a (semi-)alphabet object.
Definition: concept.hpp:155
The basis for seqan3::alphabet, but requires only rank interface (not char).
SeqAn specific customisations in the standard namespace.
size_t operator()(alphabet_t const character) const noexcept
Compute the hash for a character.
Definition: hash.hpp:39