[libcxx-commits] [PATCH] D99041: [libcxx] moves `std::invoke` into `__functional_base`

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 22 08:44:16 PDT 2021

Quuxplusone added a comment.

@ldionne wrote:

> Is it possible to split it into a header `__functional/invoke.h`? If not, why?

FWIW, I'd strongly oppose that. If we're going to start introducing dependencies on C++17 `invoke` (where the rest of libc++ right now takes dependencies only on C++11 `__invoke`), then don't want `__invoke` and `invoke` separated from each other //at all//. If we're going to treat `invoke` as synonymous with `__invoke`, then the synonyms belong together in the same header.

Separately, I'm opposed to creating a "second style precedent" of `__functional/foo.h` when we already have the established style convention of `__functional_foo`. (But this is trivially solved by calling a hypothetical new header `__functional_invoke` instead of `__functional/invoke.h`.)

Pragmatically, `__invoke` depends on `__invoke_return` etc., which right now are scattered among `__functional_base` and `__functional_base_03`. So moving `invoke` into a new header outside of `__functional_base`, //without// making that new header //itself// include `__functional_base`, seems like a relatively major task. (And of course if the new header //does// depend on `__functional_base` then you haven't gained anything, relative to this PR as-is.)

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list