SeqAn3  3.2.0-rc.1
The Modern C++ library for sequence analysis.
hash.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2022, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2022, 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>
27 struct hash<alphabet_t>
28 {
37  size_t operator()(alphabet_t const character) const noexcept
38  {
39  return seqan3::to_rank(character);
40  }
41 };
42 
43 } // 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: alphabet/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:37