-
Notifications
You must be signed in to change notification settings - Fork 2
/
concepts.hpp
41 lines (31 loc) · 1.1 KB
/
concepts.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause
/*!\file
* \author Enrico Seiler <enrico.seiler AT fu-berlin.de>
* \brief Provides seqan::stl concepts.
*/
// File might be included from multiple libraries.
#ifndef SEQAN_STD_CONCEPTS
#define SEQAN_STD_CONCEPTS
#include <ranges>
#if __cpp_lib_ranges >= 202110L
namespace seqan::stl::ranges
{
using std::ranges::viewable_range;
}
#else
# include "detail/exposition_only.hpp"
namespace seqan::stl::ranges
{
template <class T>
concept viewable_range =
std::ranges::range<T>
&& ((std::ranges::view<std::remove_cvref_t<T>> && std::constructible_from<std::remove_cvref_t<T>, T>)
|| (!std::ranges::view<std::remove_cvref_t<T>>
&& (std::is_lvalue_reference_v<T>
|| (std::movable<std::remove_reference_t<T>>
&& !seqan::stl::detail::is_initializer_list<std::remove_cvref_t<T>>))));
} // namespace seqan::stl::ranges
#endif
#endif // SEQAN_STD_CONCEPTS