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

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 3 10:27:11 PDT 2024


ldionne 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.

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


More information about the libcxx-commits mailing list