3 ms·
A bigger problem is that iostream is still the only C++ way to read and write files. Yeah, you can still use `std::fopen` and so on, but the modern C++ strives
by lifthrasiir 3y ago
A bigger problem is that iostream is still the only C++ way to read and write files. Yeah, you can still use `std::fopen` and so on, but the modern C++ strives to minimize type-ignorant C functions right? The introduction of `std::format` made the formatting aspect of iostream obsolete, but iostream still has no standard alternative for other aspects.
- Calavar 3y agostd::print is coming with C++23. In the meantime, there's std::format_to. You still have to dump the output into an std::ostream, but at least you don't have to use the disgusting ostream interface directly.
- nly 3y agostd::filebuf can be used directly without std::fstream if you just want to read and write bytes without doing formatted operations.
- lifthrasiir 3y agoThat's fair, but `std::filebuf` still carries an `imbue` baggage...