BioC++ core-0.7.0
The Modern C++ libraries for Bioinformatics.
 
Loading...
Searching...
No Matches
to_rank.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
16#include <ranges>
17
20
21namespace bio::ranges::views
22{
23
69inline auto const to_rank = deep{std::views::transform(
70 [](auto const in) noexcept
71 {
72 static_assert(alphabet::semialphabet<decltype(in)>,
73 "The value type of bio::views::to_rank must model the bio::alphabet::alphabet.");
74 return bio::alphabet::to_rank(in);
75 })};
76
78
79} // namespace bio::ranges::views
Core alphabet concept and free function/type trait wrappers.
A wrapper type around an existing view adaptor that enables "deep view" behaviour for that view.
Definition: deep.hpp:104
The basis for bio::alphabet::alphabet, but requires only rank interface (not char).
Definition: concept.hpp:562
Provides bio::views::deep.
constexpr auto to_rank
Return the rank representation of a (semi-)alphabet object.
Definition: concept.hpp:70
auto const to_rank
A view that calls bio::alphabet::to_rank() on each element in the input range.
Definition: to_rank.hpp:69
The BioC++ namespace for views.