[libcxx-commits] [libcxx] [libc++][print] Includes <format>. (PR #76333)
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Feb 3 11:09:33 PST 2024
mordante wrote:
> > I'm happy to revisit this idea, but then it would be good to have some performance numbers. These number seem worse than the vector case. Maybe instead of doing fine-grained "header removal" we could only remove the "heavy hitters".
>
> From what I understand that patch was based around the idea of gating includes on language version. While it would help some users for a while, it's really just postponing the problem until folks move to the next -std=c++ version.
Yes that's correct.
> Another idea would be gating all the format stuff behind an #ifdef (and similar for other features), but that could also result in a huge matrix of different modes to support, so I can see why that wouldn't be desirable.
Yes that is a maintenance issue.
> Ultimately, I wish the standard provided more granular headers, so that users of basic ostream functionality wouldn't have to pay the cost of the new formatting features.
Note that chrono's ostream functionality uses `std::format`, in C++26 `std::to_string` for floating-point types also uses `std::format`. I expect format to be used in more places in the library in upcoming C++ versions.
It seems there are other users with the same issue so you might want to keep an eye on #80196
https://github.com/llvm/llvm-project/pull/76333
More information about the libcxx-commits
mailing list