C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Readncount Proposal

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Thu, 18 Sep 2025 20:53:23 +0100
On Thu, 18 Sept 2025 at 20:50, Thiago Macieira <thiago_at_[hidden]> wrote:

> On Wednesday, 17 September 2025 23:47:28 Pacific Daylight Time Jonathan
> Wakely
> wrote:
> > That's what istream::readsome is for. istream::read will block until more
> > data is available.
>
> But how, if the device is in non-blocking mode? "don't do that" ?
>

Yeah, basically. I think you'll get a busy loop if underflow returns
without filling the buffer, because istream::read will keep calling
underflow to make more characters available, until it's read the specified
number.

Received on 2025-09-18 19:53:40