Boost logo

Boost Users :

From: Seyyed Soroosh Hosseinalipour (soorosh_abi_at_[hidden])
Date: 2023-02-17 21:44:18


@vinnie.falco_at_[hidden] for example with replacing C++20/23 concept with stream abstract model in boost iostream, I think many compiles time checking and programming model changes. Or adding ranges filter into compatible form with boost iostream filter.

From: Jeff Garland <azswdude_at_[hidden]>
Sent: Friday, February 17, 2023 7:32 PM
To: boost-users_at_[hidden]
Cc: Seyyed Soroosh Hosseinalipour <soorosh_abi_at_[hidden]>
Subject: Re: [Boost-users] [iostreams] When plan to move to C++20



On Fri, Feb 10, 2023 at 12:03 PM Seyyed Soroosh Hosseinalipour via Boost-users <boost-users_at_[hidden]<mailto:boost-users_at_[hidden]>> wrote:
Thanks for reply, but many of the libraries exist in boost, after some years candidate for adding to C++ ISO, so I think if we migrate iostream to latest standard of C++, we can candidate this library for ISO, because this library is very helpful, and general as standard wants.


I think it would be perfectly reasonable to update the library for C++20 -- it can be done in a way (aka version macros) backward compatible with older c++ libraries.

That said, I don't think this design is where the standard is headed in 2023. Additions to I/O in c++20/23 have largely focused on format and print from fmtlib. And for good reasons - performance, flexibility, lack of ABI issues under many evolution scenarios, and unicode support. As simple example, in c++23 you can say:

  vector<int> v = { 1, 2, 3};
  print( "{}", v ); //[1, 2, 3]
  map<string, int> m = { {"foo", 1}, { "bar", 2 }};
  print( "{}", m ); //{ "bar": 2, "foo", 1}

https://godbolt.org/z/ex4Kerqeq

This is stuff that is fundamental and goes away from the traditional streams model. Note print does work files and streams as well, but it isn't required to. Many of the filtering cases are now covered by facilities like ranges::views::filter. So I'm not sure there's much appetite for going this direction.

Jeff



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net