[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
Thu Sep 5 02:18:34 PDT 2024
philnik777 wrote:
> > I think that should work and avoids the dependency problem. The module names could probably be better.
>
> This is basically equivalent to moving `__utility/forward.h` into `__type_traits`. I could also do that, but it feels like `forward.h` doesn't belong there.
>
> Alternatively, your suggestion can be seen as:
>
> ```
> module core {
> module type_traits { ... }
> module basic_utilities {
> header "__utility/forward.h"
> header "__utility/declval.h"
> header "__utility/move.h"
> }
> }
> ```
>
> But then that begs the question of defining what the `core` module is, which seems a bit arbitrary to me. It would also mean that our directory hierarchy does not mirror the modulemap anymore, which I can live with but certainly would find nice if we could have that property.
I'd rather do that for now and I'm fine with having somewhat arbitrary modules for some time. If this is actually fundamentally necessary we can look into removing the cycle later, but I'm not yet convinced it actually is. Basically, I'd rather sacrifice a bit of modulemap simplicity than code readability at this point, since we don't yet really know where the modulemap journey will get us.
https://github.com/llvm/llvm-project/pull/106795
More information about the libcxx-commits
mailing list