Date: Tue, 25 Apr 2023 13:22:30 -0400
On Tue, Apr 25, 2023 at 12:47 PM Louis Langholtz via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> The idea is to simply to add an interface to std::fstream::open that provided an fstream to "a temporary file with a unique auto-generated filename” opened with “wb+x” mode - like that produced by std::tmpfile. This would solve a seemingly otherwise vexing task of re-inventing the standard library’s existing wheels for using FILE* under the hood for std::cin, std::cout, etc without needing to expose a FILE* based interface which could still be done but orthogonally.
Is `tmpfile` functionality commonly needed enough that the standard
library needs to incorporate it into fstream?
> This could be achieved simply by offering a no-parameters version of the aforementioned open member function:
>
> void open();
>
> Which to me at least, naturally suggests opening an unnamed file that was unique to the call and open for “wb+” access.
What about this function's signature suggests *any* of those things?
At least `tmpfile` says what it's doing.
<std-proposals_at_[hidden]> wrote:
>
> The idea is to simply to add an interface to std::fstream::open that provided an fstream to "a temporary file with a unique auto-generated filename” opened with “wb+x” mode - like that produced by std::tmpfile. This would solve a seemingly otherwise vexing task of re-inventing the standard library’s existing wheels for using FILE* under the hood for std::cin, std::cout, etc without needing to expose a FILE* based interface which could still be done but orthogonally.
Is `tmpfile` functionality commonly needed enough that the standard
library needs to incorporate it into fstream?
> This could be achieved simply by offering a no-parameters version of the aforementioned open member function:
>
> void open();
>
> Which to me at least, naturally suggests opening an unnamed file that was unique to the call and open for “wb+” access.
What about this function's signature suggests *any* of those things?
At least `tmpfile` says what it's doing.
Received on 2023-04-25 17:22:41