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