SeqAn3
3.4.0
The Modern C++ library for sequence analysis.
Toggle main menu visibility
Loading...
Searching...
No Matches
customisation_point.hpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
2
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
3
// SPDX-License-Identifier: BSD-3-Clause
4
9
10
#pragma once
11
12
#include <
utility
>
13
14
#include <
seqan3/core/platform.hpp
>
15
16
namespace
seqan3::detail
17
{
18
19
// ============================================================================
20
// priority_tag
21
// ============================================================================
22
25
template
<
size_t
I>
26
struct
priority_tag
28
// Doxygen fail
29
: priority_tag<I - 1>
31
{};
32
34
template
<>
35
struct
priority_tag<0>
36
{};
37
38
}
// namespace seqan3::detail
39
40
// ============================================================================
41
// SEQAN3_CPO_OVERLOAD
42
// ============================================================================
43
#if SEQAN3_DOXYGEN_ONLY(1) 0
61
# define SEQAN3_CPO_OVERLOAD_BODY(...) \
62
noexcept(auto) \
63
{ \
64
return __VA_ARGS__; \
65
}
66
#else
// ^^^ (simplified) doxygen version / normal definition vvv
67
# define SEQAN3_CPO_OVERLOAD_BODY(...) \
68
noexcept(noexcept(__VA_ARGS__))->decltype(__VA_ARGS__) \
69
{ \
70
return __VA_ARGS__; \
71
} \
72
static_assert(true)
73
#endif
74
106
#define SEQAN3_CPO_OVERLOAD(...) cpo_overload(__VA_ARGS__) SEQAN3_CPO_OVERLOAD_BODY
107
108
namespace
seqan3::detail
109
{
138
template
<
typename
derived_t,
unsigned
max_priority>
139
struct
customisation_point_object
140
{
141
private
:
143
friend
derived_t;
144
145
constexpr
customisation_point_object() =
default
;
146
constexpr
customisation_point_object(customisation_point_object &&) =
default
;
147
constexpr
customisation_point_object(customisation_point_object
const
&) =
default
;
148
constexpr
customisation_point_object & operator=(customisation_point_object &&) =
default
;
149
constexpr
customisation_point_object & operator=(customisation_point_object
const
&) =
default
;
150
151
public
:
162
template
<
typename
... args_t,
typename
derived_type = derived_t
/*circumvent incomplete types*/
>
163
constexpr
auto
operator()(args_t &&... args)
const
SEQAN3_CPO_OVERLOAD_BODY
(
164
/*return*/
derived_type::cpo_overload(priority_tag<max_priority>{},
std::forward<args_t>
(args)...)
/*;*/
165
);
166
};
167
}
// namespace seqan3::detail
SEQAN3_CPO_OVERLOAD_BODY
#define SEQAN3_CPO_OVERLOAD_BODY(...)
A macro helper for SEQAN3_CPO_OVERLOAD.
Definition
customisation_point.hpp:61
std::forward
T forward(T... args)
platform.hpp
Provides platform and dependency checks.
utility
Hide me
Version:
seqan3
core
detail
customisation_point.hpp
Generated on
for SeqAn3 by
1.17.0