BioC++ core-0.7.0
The Modern C++ libraries for Bioinformatics.
 
Loading...
Searching...
No Matches
concept.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
19
20namespace bio::ranges::detail
21{
22
24template <class range_t>
25concept simple_view = std::ranges::view<range_t> && std::ranges::range<range_t const> &&
26 std::same_as<std::ranges::iterator_t<range_t>, std::ranges::iterator_t<range_t const>> &&
27 std::same_as<std::ranges::sentinel_t<range_t>, std::ranges::sentinel_t<range_t const>>;
28
29} // namespace bio::ranges::detail
30
31namespace bio::ranges
32{
33
52template <typename type>
54 std::ranges::input_range<std::remove_const_t<type>> && std::ranges::input_range<type const> &&
55 (std::ranges::forward_range<std::remove_const_t<type>> == std::ranges::forward_range<type const>)&&(
56 std::ranges::bidirectional_range<std::remove_const_t<type>> ==
57 std::ranges::bidirectional_range<type const>)&&(std::ranges::random_access_range<std::remove_const_t<type>> ==
58 std::ranges::random_access_range<type const>);
59
65template <typename rng_t, typename val_t>
66concept back_insertable_with = requires(rng_t & v) { v.push_back(std::declval<val_t>()); };
67
73template <typename rng_t>
76
82template <typename rng_t, typename... args_t>
83concept back_emplaceable_with = requires(rng_t & v) { v.emplace_back(std::declval<args_t>()...); };
84
85} // namespace bio::ranges
Core alphabet concept and free function/type trait wrappers.
Describes range types that can grow in amortised constant time by appending an element which is const...
Definition: concept.hpp:83
Describes range types that can grow in amortised constant time by appending an element of type val_t.
Definition: concept.hpp:66
Describes range types that can grow in amortised constant time by appending an element.
Definition: concept.hpp:74
Specifies requirements of an input range type for which the const version of that type satisfies the ...
Definition: concept.hpp:53
The ranges module's namespace.