SeqAn3  3.0.3
The Modern C++ library for sequence analysis.
customisation_point.hpp File Reference

Helper utilities for defining customisation point objects (CPOs). More...

+ Include dependency graph for customisation_point.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 seqan3
 The main SeqAn3 namespace.
 

Macros

#define SEQAN3_CPO_IMPL(PRIO, TERM)
 A macro that helps defining the overload set of a customisation point. More...
 
#define SEQAN3_CPO_OVERLOAD(...)
 A macro that helps to define a seqan3::detail::customisation_point_object. More...
 
#define SEQAN3_CPO_OVERLOAD_BODY(...)   noexcept(auto) { return __VA_ARGS__; }
 A macro helper for SEQAN3_CPO_OVERLOAD. More...
 

Detailed Description

Helper utilities for defining customisation point objects (CPOs).

Author
Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>

Macro Definition Documentation

◆ SEQAN3_CPO_IMPL

#define SEQAN3_CPO_IMPL (   PRIO,
  TERM 
)
Value:
\
template <typename t, typename ...arg_ts> \
static constexpr decltype(auto) impl(seqan3::detail::priority_tag<PRIO>, \
[[maybe_unused]] t && v, \
[[maybe_unused]] arg_ts && ... args) \
noexcept(noexcept(TERM)) \
requires requires (seqan3::detail::priority_tag<PRIO> const &/*<- need for doxygen*/, t && v, arg_ts && ... args)\
{ { TERM }; } \
{ \
return TERM; \
}
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29

A macro that helps defining the overload set of a customisation point.

Deprecated:
Please use SEQAN3_CPO_OVERLOAD to define seqan3::detail::customisation_point_object instead.

◆ SEQAN3_CPO_OVERLOAD

#define SEQAN3_CPO_OVERLOAD (   ...)
Value:
cpo_overload(__VA_ARGS__) \
SEQAN3_CPO_OVERLOAD_BODY

A macro that helps to define a seqan3::detail::customisation_point_object.

Expands to a function definition with the name cpo_overload.

It puts the given expression via SEQAN3_CPO_OVERLOAD_BODY as a single return statement in the function body, the noexcept declaration and requires declaration.

template <typename range_t>
requires true // further constraints
static constexpr auto SEQAN3_CPO_OVERLOAD(seqan3::detail::priority_tag<1>, range_t && range)
(
/*return*/ std::forward<range_t>(range).begin() /*;*/
);
#define SEQAN3_CPO_OVERLOAD(...)
A macro that helps to define a seqan3::detail::customisation_point_object.
Definition: customisation_point.hpp:113

expands to something similar to

template <typename range_t>
requires true // further constraints
static constexpr auto cpo_overload(seqan3::detail::priority_tag<1>, range_t && range)
noexcept(noexcept(std::forward<range_t>(range).begin()))
requires requires()
{
{std::forward<range_t>(range).begin()};
}
{
return std::forward<range_t>(range).begin();
}
T begin(T... args)

◆ SEQAN3_CPO_OVERLOAD_BODY

#define SEQAN3_CPO_OVERLOAD_BODY (   ...)    noexcept(auto) { return __VA_ARGS__; }

A macro helper for SEQAN3_CPO_OVERLOAD.

Please note that in order to allow a semicolon at the end when using this macro, i.e.

(
...
);
#define SEQAN3_CPO_OVERLOAD_BODY(...)
A macro helper for SEQAN3_CPO_OVERLOAD.
Definition: customisation_point.hpp:76

we need some expression at the end of the macro that can have a semicolon appended. We chose static_assert(true) for that reason.