[libcxx-commits] [libcxx] [libc++][modules] Remove a dependency of __type_traits/invoke.h on __utility (PR #106795)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 3 10:33:10 PDT 2024


philnik777 wrote:

> > What exactly is the benefit here? This feels a lot like making the code worse to make a tool happy.
> 
> The benefit is that we no longer include anything from `__utility/` from a header inside `__type_traits/`. This lays down the foundation for `__type_traits` being a dependency-free module in the modulemap, which allows us to make it a single module (instead of multiple separate modules like it is today).
> 
> Another option would be to move `forward.h` out of `__utility/` into its own module (or into its own dependency-free module that could e.g. contain `std::move`, `std::forward`, `std::declval` and maybe a few others). But I went for the simplest change I could think about here.

I think I'd rather go for having an extra module for now. I have a feeling that we can absorb most of the modulemap into a single large module, which would make the cross-module dependencies not a problem.


https://github.com/llvm/llvm-project/pull/106795


More information about the libcxx-commits mailing list