C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::bin manipulator for integer binary input/output

From: Tiago Freire <tmiguelf_at_[hidden]>
Date: Tue, 11 Feb 2025 15:03:10 +0000
I personally never found input scanning at all useful because of practical limitation.

First files/data that you may want to parse have an encoding, and the reader needs to be encode aware to a certain extent. Even if that wasn't a problem, things have an underlying format.
For example, let's say you are parsing json, you need to be aware of control characters and delimeters even before you can make sense of the value of the content; once the value is properly delimited then processing is rather trivial (either copy the string, or convert a number with from_chars); failing the delimeters is a parsing error.
Similar story for xml, or <insert format here>.

To the point were actually finding a use case to use such scanning facilities to be virtually non-existent, and even much less those that can take advantage of their custom parsing rules.



________________________________
From: Std-Proposals <std-proposals-bounces_at_[hidden]> on behalf of Jonathan Wakely via Std-Proposals <std-proposals_at_[hidden]>
Sent: Tuesday, February 11, 2025 1:23:54 PM
To: std-proposals_at_[hidden] <std-proposals_at_[hidden]>
Cc: Jonathan Wakely <cxx_at_[hidden]>
Subject: Re: [std-proposals] std::bin manipulator for integer binary input/output



On Mon, 10 Feb 2025 at 19:35, Simon Schröder via Std-Proposals <std-proposals_at_[hidden]<mailto:std-proposals_at_[hidden]>> wrote:
Well, I agree that we don‘t necessarily need any extensions of ostreams because we have std::format and std::print (though nothing equivalent to std::print for writing to files directly). But, there not a replacement for istreams, yet. Is there any proposal to replace istreams?


https://wg21.link/p1729


Received on 2025-02-11 15:03:15