Boost logo

Boost :

From: Julien Blanc (julien.blanc_at_[hidden])
Date: 2023-11-09 16:22:27


Le 2023-11-09 16:21, Klemens Morgenstern via Boost a écrit :
> On Thu, Nov 9, 2023 at 11:00 PM Julien Blanc via Boost
> <boost_at_[hidden]> wrote:

>> (1) template<asio::cancellation_type Ct =
>> asio::cancellation_type::all,
>> non_empty_range<awaitable> PromiseRange>
>> awaitable left_race(PromiseRange && p);
>>
>
> How is `non_empty_range` defined?

range<awaitable> is already pseudo-code, so i'm not sure why you ask.
But you're right, i've been mislead by the current doc. I was going to
reply that it could at the very least be defined as:

template<typename T>
concept non_empty_range = std::ranges::range<T>; // self-documenting
alias. Gives opportunity for future improvements

However, this is not what we want here. What we want here is a non_empty
range of<awaitable>. So i believe the correct documentation should be
non_empty_range_of<awaitable>.

Of course, it's still pseudo-code. This makes me rises the concern about
using pseudo-code in the documentation, without telling so. Especially
with features the reader might not be familiar with, such as concepts
and coroutines, which . Maybe there should be a convention across the
documentation to differentiate between valid c++ code and pseudo-code
(pseudo-code is useful for clarity in certain situations). In all cases,
i think that a misleading pseudo-code is a documentation bug that should
be fixed. A library targetting c++20 should not misuse the "range" name.

Best regards,

Julien


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk