The documentation occasionally references snippets that are verbatim from the library.
For example:
|
// tag::executor_concept[] |
|
template<class E> |
|
concept Executor = |
|
std::is_nothrow_copy_constructible_v<E> && |
|
std::is_nothrow_move_constructible_v<E> && |
|
requires(E& e, E const& ce, E const& ce2, |
|
continuation c) |
|
{ |
|
{ ce == ce2 } noexcept -> std::convertible_to<bool>; |
|
{ ce.context() } noexcept; |
|
requires std::is_lvalue_reference_v< |
|
decltype(ce.context())> && |
|
std::derived_from< |
|
std::remove_reference_t< |
|
decltype(ce.context())>, |
|
execution_context>; |
|
{ ce.on_work_started() } noexcept; |
|
{ ce.on_work_finished() } noexcept; |
|
|
|
{ ce.dispatch(c) } -> std::same_as<std::coroutine_handle<>>; |
|
{ ce.post(c) }; |
|
}; |
|
// end::executor_concept[] |
is an exact copy of:
|
template<class E> |
|
concept Executor = |
|
std::is_nothrow_copy_constructible_v<E> && |
|
std::is_nothrow_move_constructible_v<E> && |
|
requires(E& e, E const& ce, E const& ce2, continuation c) { |
|
{ ce == ce2 } noexcept -> std::convertible_to<bool>; |
|
{ ce.context() } noexcept; |
|
requires std::is_lvalue_reference_v<decltype(ce.context())> && |
|
std::derived_from< |
|
std::remove_reference_t<decltype(ce.context())>, |
|
execution_context>; |
|
{ ce.on_work_started() } noexcept; |
|
{ ce.on_work_finished() } noexcept; |
|
|
|
{ ce.dispatch(c) } -> std::same_as<std::coroutine_handle<>>; |
|
{ ce.post(c) }; |
|
}; |
The purpose of the snippets is to ensure they build and cannot drift. This concept being redeclared allows for drift.
All snippets should be audited for similar instances and tagged to use code from the library itself so it is impossible for these doc references to drift from the library.
The documentation occasionally references snippets that are verbatim from the library.
For example:
capy/test/doc/snippets/9k_executor.cpp
Lines 66 to 88 in aed1c30
is an exact copy of:
capy/include/boost/capy/concept/executor.hpp
Lines 165 to 181 in aed1c30
The purpose of the snippets is to ensure they build and cannot drift. This concept being redeclared allows for drift.
All snippets should be audited for similar instances and tagged to use code from the library itself so it is impossible for these doc references to drift from the library.